Commit 2a460cca authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

[XProto] Remove old x11::* constants

BUG=1066670
R=sky

Change-Id: I3df7737031e8aecc9463b8f42fb5bcf8b5722693
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2410841
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807165}
parent faa1a22b
...@@ -111,7 +111,7 @@ bool GlobalShortcutListenerX11::RegisterAcceleratorImpl( ...@@ -111,7 +111,7 @@ bool GlobalShortcutListenerX11::RegisterAcceleratorImpl(
// Caps lock, Scroll lock. See comment about |kModifiersMasks|. // Caps lock, Scroll lock. See comment about |kModifiersMasks|.
for (unsigned int kModifiersMask : kModifiersMasks) { for (unsigned int kModifiersMask : kModifiersMasks) {
XGrabKey(x_display_, keycode, modifiers | kModifiersMask, XGrabKey(x_display_, keycode, modifiers | kModifiersMask,
static_cast<uint32_t>(x_root_window_), x11::False, GrabModeAsync, static_cast<uint32_t>(x_root_window_), false, GrabModeAsync,
GrabModeAsync); GrabModeAsync);
} }
......
...@@ -191,8 +191,8 @@ class Simulator { ...@@ -191,8 +191,8 @@ class Simulator {
display_, kVisualIdMask, &visual_info_template, &visual_info_count); display_, kVisualIdMask, &visual_info_template, &visual_info_count);
for (int i = 0; i < visual_info_count && !gl_context_; ++i) { for (int i = 0; i < visual_info_count && !gl_context_; ++i) {
gl_context_ = glXCreateContext(display_, visual_info_list + i, 0, gl_context_ = glXCreateContext(display_, visual_info_list + i, nullptr,
x11::True /* Direct rendering */); true /* Direct rendering */);
} }
XFree(visual_info_list); XFree(visual_info_list);
......
...@@ -168,7 +168,6 @@ class InputInjectorX11 : public InputInjector { ...@@ -168,7 +168,6 @@ class InputInjectorX11 : public InputInjector {
// X11 graphics context. // X11 graphics context.
x11::Connection connection_; x11::Connection connection_;
Display* display_ = connection_.display(); Display* display_ = connection_.display();
Window root_window_ = x11::None;
// Number of buttons we support. // Number of buttons we support.
// Left, Right, Middle, VScroll Up/Down, HScroll Left/Right, back, forward. // Left, Right, Middle, VScroll Up/Down, HScroll Left/Right, back, forward.
...@@ -243,12 +242,6 @@ bool InputInjectorX11::Core::Init() { ...@@ -243,12 +242,6 @@ bool InputInjectorX11::Core::Init() {
task_runner_->PostTask(FROM_HERE, task_runner_->PostTask(FROM_HERE,
base::BindOnce(&Core::InitClipboard, this)); base::BindOnce(&Core::InitClipboard, this));
root_window_ = XDefaultRootWindow(display_);
if (!root_window_) {
LOG(ERROR) << "Unable to get the root window";
return false;
}
if (!IgnoreXServerGrabs(&connection_, true)) { if (!IgnoreXServerGrabs(&connection_, true)) {
LOG(ERROR) << "Server does not support XTest."; LOG(ERROR) << "Server does not support XTest.";
return false; return false;
...@@ -393,7 +386,7 @@ bool InputInjectorX11::Core::IsLockKey(KeyCode keycode) { ...@@ -393,7 +386,7 @@ bool InputInjectorX11::Core::IsLockKey(KeyCode keycode) {
auto mods = state->baseMods | state->latchedMods | state->lockedMods; auto mods = state->baseMods | state->latchedMods | state->lockedMods;
KeySym keysym; KeySym keysym;
if (state && XkbLookupKeySym(display_, keycode, static_cast<unsigned>(mods), if (state && XkbLookupKeySym(display_, keycode, static_cast<unsigned>(mods),
nullptr, &keysym) == x11::True) { nullptr, &keysym)) {
return keysym == XK_Caps_Lock || keysym == XK_Num_Lock; return keysym == XK_Caps_Lock || keysym == XK_Num_Lock;
} else { } else {
return false; return false;
......
This diff is collapsed.
...@@ -53,7 +53,7 @@ class XServerClipboard { ...@@ -53,7 +53,7 @@ class XServerClipboard {
private: private:
// Handlers called by ProcessXEvent() for each event type. // Handlers called by ProcessXEvent() for each event type.
void OnSetSelectionOwnerNotify(Atom selection, Time timestamp); void OnSetSelectionOwnerNotify(x11::Atom selection, x11::Time timestamp);
void OnPropertyNotify(const x11::PropertyNotifyEvent& event); void OnPropertyNotify(const x11::PropertyNotifyEvent& event);
void OnSelectionNotify(const x11::SelectionNotifyEvent& event); void OnSelectionNotify(const x11::SelectionNotifyEvent& event);
void OnSelectionRequest(const x11::SelectionRequestEvent& event); void OnSelectionRequest(const x11::SelectionRequestEvent& event);
...@@ -63,9 +63,11 @@ class XServerClipboard { ...@@ -63,9 +63,11 @@ class XServerClipboard {
// clipboard content. This is done by changing the property |property| of the // clipboard content. This is done by changing the property |property| of the
// |requestor| window (these values come from the XSelectionRequestEvent). // |requestor| window (these values come from the XSelectionRequestEvent).
// |target| must be a string type (STRING or UTF8_STRING). // |target| must be a string type (STRING or UTF8_STRING).
void SendTargetsResponse(Window requestor, Atom property); void SendTargetsResponse(x11::Window requestor, x11::Atom property);
void SendTimestampResponse(Window requestor, Atom property); void SendTimestampResponse(x11::Window requestor, x11::Atom property);
void SendStringResponse(Window requestor, Atom property, Atom target); void SendStringResponse(x11::Window requestor,
x11::Atom property,
x11::Atom target);
// Called by OnSelectionNotify() when the selection owner has replied to a // Called by OnSelectionNotify() when the selection owner has replied to a
// request for information about a selection. // request for information about a selection.
...@@ -73,10 +75,10 @@ class XServerClipboard { ...@@ -73,10 +75,10 @@ class XServerClipboard {
// |type|, |format| etc are the results from XGetWindowProperty(), or 0 if // |type|, |format| etc are the results from XGetWindowProperty(), or 0 if
// there is no associated data. // there is no associated data.
void HandleSelectionNotify(const x11::SelectionNotifyEvent& event, void HandleSelectionNotify(const x11::SelectionNotifyEvent& event,
Atom type, x11::Atom type,
int format, int format,
int item_count, int item_count,
void* data); const void* data);
// These methods return true if selection processing is complete, false // These methods return true if selection processing is complete, false
// otherwise. They are called from HandleSelectionNotify(), and take the same // otherwise. They are called from HandleSelectionNotify(), and take the same
...@@ -84,42 +86,42 @@ class XServerClipboard { ...@@ -84,42 +86,42 @@ class XServerClipboard {
bool HandleSelectionTargetsEvent(const x11::SelectionNotifyEvent& event, bool HandleSelectionTargetsEvent(const x11::SelectionNotifyEvent& event,
int format, int format,
int item_count, int item_count,
void* data); const void* data);
bool HandleSelectionStringEvent(const x11::SelectionNotifyEvent& event, bool HandleSelectionStringEvent(const x11::SelectionNotifyEvent& event,
int format, int format,
int item_count, int item_count,
void* data); const void* data);
// Notify the registered callback of new clipboard text. // Notify the registered callback of new clipboard text.
void NotifyClipboardText(const std::string& text); void NotifyClipboardText(const std::string& text);
// These methods trigger the X server or selection owner to send back an // These methods trigger the X server or selection owner to send back an
// event containing the requested information. // event containing the requested information.
void RequestSelectionTargets(Atom selection); void RequestSelectionTargets(x11::Atom selection);
void RequestSelectionString(Atom selection, Atom target); void RequestSelectionString(x11::Atom selection, x11::Atom target);
// Assert ownership of the specified |selection|. // Assert ownership of the specified |selection|.
void AssertSelectionOwnership(Atom selection); void AssertSelectionOwnership(x11::Atom selection);
bool IsSelectionOwner(Atom selection); bool IsSelectionOwner(x11::Atom selection);
// Stores the connection supplied to Init(). // Stores the connection supplied to Init().
x11::Connection* connection_ = nullptr; x11::Connection* connection_ = nullptr;
// Window through which clipboard events are received, or BadValue if the // Window through which clipboard events are received, or BadValue if the
// window could not be created. // window could not be created.
Window clipboard_window_; x11::Window clipboard_window_ = x11::Window::None;
// Cached atoms for various strings, initialized during Init(). // Cached atoms for various strings, initialized during Init().
Atom clipboard_atom_; x11::Atom clipboard_atom_ = x11::Atom::None;
Atom large_selection_atom_; x11::Atom large_selection_atom_ = x11::Atom::None;
Atom selection_string_atom_; x11::Atom selection_string_atom_ = x11::Atom::None;
Atom targets_atom_; x11::Atom targets_atom_ = x11::Atom::None;
Atom timestamp_atom_; x11::Atom timestamp_atom_ = x11::Atom::None;
Atom utf8_string_atom_; x11::Atom utf8_string_atom_ = x11::Atom::None;
// The set of X selections owned by |clipboard_window_| (can be Primary or // The set of X selections owned by |clipboard_window_| (can be Primary or
// Clipboard or both). // Clipboard or both).
std::set<Atom> selections_owned_; std::set<x11::Atom> selections_owned_;
// Clipboard content to return to other applications when |clipboard_window_| // Clipboard content to return to other applications when |clipboard_window_|
// owns a selection. // owns a selection.
...@@ -127,7 +129,7 @@ class XServerClipboard { ...@@ -127,7 +129,7 @@ class XServerClipboard {
// Stores the property to use for large transfers, or None if a large // Stores the property to use for large transfers, or None if a large
// transfer is not currently in-progress. // transfer is not currently in-progress.
Atom large_selection_property_; x11::Atom large_selection_property_ = x11::Atom::None;
// Remembers the start time of selection processing, and is set to null when // Remembers the start time of selection processing, and is set to null when
// processing is complete. This is used to decide whether to begin processing // processing is complete. This is used to decide whether to begin processing
......
...@@ -672,7 +672,7 @@ void XDragDropClient::SendXdndLeave(x11::Window dest_window) { ...@@ -672,7 +672,7 @@ void XDragDropClient::SendXdndLeave(x11::Window dest_window) {
void XDragDropClient::SendXdndDrop(x11::Window dest_window) { void XDragDropClient::SendXdndDrop(x11::Window dest_window) {
auto xev = PrepareXdndClientMessage(kXdndDrop, dest_window); auto xev = PrepareXdndClientMessage(kXdndDrop, dest_window);
xev.data.data32[2] = x11::CurrentTime; xev.data.data32[2] = static_cast<uint32_t>(x11::Time::CurrentTime);
SendXClientEvent(dest_window, xev); SendXClientEvent(dest_window, xev);
} }
......
...@@ -28,7 +28,7 @@ TestCompositorHostX11::~TestCompositorHostX11() = default; ...@@ -28,7 +28,7 @@ TestCompositorHostX11::~TestCompositorHostX11() = default;
void TestCompositorHostX11::Show() { void TestCompositorHostX11::Show() {
XDisplay* display = gfx::GetXDisplay(); XDisplay* display = gfx::GetXDisplay();
XSetWindowAttributes swa; XSetWindowAttributes swa;
swa.override_redirect = x11::True; swa.override_redirect = true;
window_ = static_cast<x11::Window>(XCreateWindow( window_ = static_cast<x11::Window>(XCreateWindow(
display, XDefaultRootWindow(display), // parent display, XDefaultRootWindow(display), // parent
bounds_.x(), bounds_.y(), bounds_.width(), bounds_.height(), bounds_.x(), bounds_.y(), bounds_.width(), bounds_.height(),
...@@ -42,7 +42,7 @@ void TestCompositorHostX11::Show() { ...@@ -42,7 +42,7 @@ void TestCompositorHostX11::Show() {
XMapWindow(display, static_cast<uint32_t>(window_)); XMapWindow(display, static_cast<uint32_t>(window_));
// Since this window is override-redirect, syncing is sufficient // Since this window is override-redirect, syncing is sufficient
// to ensure the map is complete. // to ensure the map is complete.
XSync(display, x11::False); XSync(display, false);
allocator_.GenerateId(); allocator_.GenerateId();
compositor_.SetAcceleratedWidget( compositor_.SetAcceleratedWidget(
static_cast<gfx::AcceleratedWidget>(window_)); static_cast<gfx::AcceleratedWidget>(window_));
......
...@@ -114,7 +114,7 @@ void KeyboardHookX11::CaptureKeyForDomCode(DomCode dom_code) { ...@@ -114,7 +114,7 @@ void KeyboardHookX11::CaptureKeyForDomCode(DomCode dom_code) {
// error handler for debugging purposes but are not used to judge success. // error handler for debugging purposes but are not used to judge success.
XGrabKey(x_display_, native_key_code, modifier, XGrabKey(x_display_, native_key_code, modifier,
static_cast<uint32_t>(x_window_), static_cast<uint32_t>(x_window_),
/*owner_events=*/x11::False, /*owner_events=*/false,
/*pointer_mode=*/GrabModeAsync, /*pointer_mode=*/GrabModeAsync,
/*keyboard_mode=*/GrabModeAsync); /*keyboard_mode=*/GrabModeAsync);
} }
......
...@@ -376,13 +376,4 @@ inline int XkbBuildCoreState(int m, int g) { ...@@ -376,13 +376,4 @@ inline int XkbBuildCoreState(int m, int g) {
return ((g & 0x3) << 13) | (m & 0xff); return ((g & 0x3) << 13) | (m & 0xff);
} }
// Deprecated.
namespace x11 {
static constexpr unsigned long None = 0L;
static constexpr long CurrentTime = 0L;
static constexpr int False = 0;
static constexpr int True = 1;
static constexpr int Success = 0;
} // namespace x11
#endif // UI_GFX_X_X11_H_ #endif // UI_GFX_X_X11_H_
...@@ -22,7 +22,7 @@ int X11ErrorHandler(Display* display, XErrorEvent* error) { ...@@ -22,7 +22,7 @@ int X11ErrorHandler(Display* display, XErrorEvent* error) {
namespace gfx { namespace gfx {
X11ErrorTracker::X11ErrorTracker() { X11ErrorTracker::X11ErrorTracker() {
XSync(GetXDisplay(), x11::False); XSync(GetXDisplay(), false);
old_handler_ = reinterpret_cast<void*>(XSetErrorHandler(X11ErrorHandler)); old_handler_ = reinterpret_cast<void*>(XSetErrorHandler(X11ErrorHandler));
g_x11_error_code = 0; g_x11_error_code = 0;
} }
...@@ -32,7 +32,7 @@ X11ErrorTracker::~X11ErrorTracker() { ...@@ -32,7 +32,7 @@ X11ErrorTracker::~X11ErrorTracker() {
} }
bool X11ErrorTracker::FoundNewError() { bool X11ErrorTracker::FoundNewError() {
XSync(GetXDisplay(), x11::False); XSync(GetXDisplay(), false);
unsigned char error = g_x11_error_code; unsigned char error = g_x11_error_code;
g_x11_error_code = 0; g_x11_error_code = 0;
return error != 0; return error != 0;
......
...@@ -57,10 +57,10 @@ GLXContext CreateContextAttribs(Display* display, ...@@ -57,10 +57,10 @@ GLXContext CreateContextAttribs(Display* display,
// errors can be generated. To prevent these errors from crashing our process, // errors can be generated. To prevent these errors from crashing our process,
// we simply ignore them and only look if the GLXContext was created. // we simply ignore them and only look if the GLXContext was created.
// Sync to ensure any errors generated are processed. // Sync to ensure any errors generated are processed.
XSync(display, x11::False); XSync(display, false);
auto old_error_handler = XSetErrorHandler(IgnoreX11Errors); auto old_error_handler = XSetErrorHandler(IgnoreX11Errors);
GLXContext context = glXCreateContextAttribsARB(display, config, share, GLXContext context =
x11::True, attribs.data()); glXCreateContextAttribsARB(display, config, share, true, attribs.data());
XSetErrorHandler(old_error_handler); XSetErrorHandler(old_error_handler);
return context; return context;
...@@ -182,7 +182,7 @@ bool GLContextGLX::Initialize(GLSurface* compatible_surface, ...@@ -182,7 +182,7 @@ bool GLContextGLX::Initialize(GLSurface* compatible_surface,
DVLOG(1) << "GLX_ARB_create_context not supported."; DVLOG(1) << "GLX_ARB_create_context not supported.";
context_ = glXCreateNewContext( context_ = glXCreateNewContext(
display_, static_cast<GLXFBConfig>(compatible_surface->GetConfig()), display_, static_cast<GLXFBConfig>(compatible_surface->GetConfig()),
GLX_RGBA_TYPE, share_handle, x11::True); GLX_RGBA_TYPE, share_handle, true);
if (!context_) { if (!context_) {
LOG(ERROR) << "Failed to create GL context with glXCreateNewContext."; LOG(ERROR) << "Failed to create GL context with glXCreateNewContext.";
return false; return false;
......
...@@ -34,7 +34,7 @@ TEST(GLContextGLXTest, MAYBE_DoNotDestroyOnFailedMakeCurrent) { ...@@ -34,7 +34,7 @@ TEST(GLContextGLXTest, MAYBE_DoNotDestroyOnFailedMakeCurrent) {
XSetWindowAttributes swa; XSetWindowAttributes swa;
memset(&swa, 0, sizeof(swa)); memset(&swa, 0, sizeof(swa));
swa.background_pixmap = 0; swa.background_pixmap = 0;
swa.override_redirect = x11::True; swa.override_redirect = true;
auto xwindow = static_cast<x11::Window>(XCreateWindow( auto xwindow = static_cast<x11::Window>(XCreateWindow(
xdisplay, XDefaultRootWindow(xdisplay), 0, 0, 10, xdisplay, XDefaultRootWindow(xdisplay), 0, 0, 10,
10, // x, y, width, height 10, // x, y, width, height
...@@ -47,7 +47,7 @@ TEST(GLContextGLXTest, MAYBE_DoNotDestroyOnFailedMakeCurrent) { ...@@ -47,7 +47,7 @@ TEST(GLContextGLXTest, MAYBE_DoNotDestroyOnFailedMakeCurrent) {
XMapWindow(xdisplay, static_cast<uint32_t>(xwindow)); XMapWindow(xdisplay, static_cast<uint32_t>(xwindow));
// Since this window is override-redirect, syncing is sufficient // Since this window is override-redirect, syncing is sufficient
// to ensure the map is complete. // to ensure the map is complete.
XSync(xdisplay, x11::False); XSync(xdisplay, false);
GLImageTestSupport::InitializeGL(base::nullopt); GLImageTestSupport::InitializeGL(base::nullopt);
auto surface = gl::InitializeGLSurface(base::MakeRefCounted<GLSurfaceGLXX11>( auto surface = gl::InitializeGLSurface(base::MakeRefCounted<GLSurfaceGLXX11>(
...@@ -64,7 +64,7 @@ TEST(GLContextGLXTest, MAYBE_DoNotDestroyOnFailedMakeCurrent) { ...@@ -64,7 +64,7 @@ TEST(GLContextGLXTest, MAYBE_DoNotDestroyOnFailedMakeCurrent) {
XDestroyWindow(xdisplay, static_cast<uint32_t>(xwindow)); XDestroyWindow(xdisplay, static_cast<uint32_t>(xwindow));
// Since this window is override-redirect, syncing is sufficient // Since this window is override-redirect, syncing is sufficient
// to ensure the window is destroyed and unmapped. // to ensure the window is destroyed and unmapped.
XSync(xdisplay, x11::False); XSync(xdisplay, false);
ASSERT_FALSE(error_tracker.FoundNewError()); ASSERT_FALSE(error_tracker.FoundNewError());
if (context->MakeCurrent(surface.get())) { if (context->MakeCurrent(surface.get())) {
...@@ -83,7 +83,7 @@ TEST(GLContextGLXTest, MAYBE_DoNotDestroyOnFailedMakeCurrent) { ...@@ -83,7 +83,7 @@ TEST(GLContextGLXTest, MAYBE_DoNotDestroyOnFailedMakeCurrent) {
// not destroyed. // not destroyed.
ASSERT_TRUE(context->GetHandle()); ASSERT_TRUE(context->GetHandle());
surface = nullptr; surface = nullptr;
XSync(xdisplay, x11::True); XSync(xdisplay, true);
} }
} // namespace gl } // namespace gl
...@@ -281,7 +281,7 @@ class SGIVideoSyncThread : public base::Thread, ...@@ -281,7 +281,7 @@ class SGIVideoSyncThread : public base::Thread,
DCHECK(task_runner()->BelongsToCurrentThread()); DCHECK(task_runner()->BelongsToCurrentThread());
if (!context_) { if (!context_) {
context_ = glXCreateNewContext(GetDisplay(), config, GLX_RGBA_TYPE, context_ = glXCreateNewContext(GetDisplay(), config, GLX_RGBA_TYPE,
nullptr, x11::True); nullptr, true);
} }
LOG_IF(ERROR, !context_) << "video_sync: glXCreateNewContext failed"; LOG_IF(ERROR, !context_) << "video_sync: glXCreateNewContext failed";
} }
...@@ -337,7 +337,7 @@ class SGIVideoSyncProviderThreadShim { ...@@ -337,7 +337,7 @@ class SGIVideoSyncProviderThreadShim {
vsync_lock_() { vsync_lock_() {
// This ensures that creation of |parent_window_| has occured when this shim // This ensures that creation of |parent_window_| has occured when this shim
// is executing in the same thread as the call to create |parent_window_|. // is executing in the same thread as the call to create |parent_window_|.
XSync(gfx::GetXDisplay(), x11::False); XSync(gfx::GetXDisplay(), false);
} }
~SGIVideoSyncProviderThreadShim() { ~SGIVideoSyncProviderThreadShim() {
......
...@@ -202,11 +202,11 @@ class X11WindowTest : public testing::Test { ...@@ -202,11 +202,11 @@ class X11WindowTest : public testing::Test {
// Make X11 synchronous for our display connection. This does not force the // Make X11 synchronous for our display connection. This does not force the
// window manager to behave synchronously. // window manager to behave synchronously.
XSynchronize(gfx::GetXDisplay(), x11::True); XSynchronize(gfx::GetXDisplay(), true);
} }
protected: protected:
void TearDown() override { XSynchronize(gfx::GetXDisplay(), x11::False); } void TearDown() override { XSynchronize(gfx::GetXDisplay(), false); }
std::unique_ptr<X11Window> CreateX11Window( std::unique_ptr<X11Window> CreateX11Window(
PlatformWindowDelegate* delegate, PlatformWindowDelegate* delegate,
......
...@@ -69,23 +69,18 @@ void DispatchMouseMotionEvent(DesktopWindowTreeHostLinux* desktop_host, ...@@ -69,23 +69,18 @@ void DispatchMouseMotionEvent(DesktopWindowTreeHostLinux* desktop_host,
gfx::Rect bounds_in_screen = desktop_host->window()->GetBoundsInScreen(); gfx::Rect bounds_in_screen = desktop_host->window()->GetBoundsInScreen();
auto* connection = x11::Connection::Get(); auto* connection = x11::Connection::Get();
xcb_generic_event_t ge; x11::MotionNotifyEvent xev{
memset(&ge, 0, sizeof(ge)); .detail = x11::Motion::Normal,
auto* xev = reinterpret_cast<xcb_motion_notify_event_t*>(&ge); .root = connection->default_root(),
xev->response_type = x11::MotionNotifyEvent::opcode; .event = static_cast<x11::Window>(desktop_host->GetAcceleratedWidget()),
xev->event = static_cast<uint32_t>(desktop_host->GetAcceleratedWidget()); .root_x = point_in_screen.x(),
xev->root = static_cast<uint32_t>(connection->default_screen().root); .root_y = point_in_screen.y(),
xev->child = 0; .event_x = point_in_screen.x() - bounds_in_screen.x(),
xev->time = x11::CurrentTime; .event_y = point_in_screen.y() - bounds_in_screen.y(),
xev->event_x = point_in_screen.x() - bounds_in_screen.x(); .same_screen = true,
xev->event_y = point_in_screen.y() - bounds_in_screen.y(); };
xev->root_x = point_in_screen.x();
xev->root_y = point_in_screen.y(); x11::Event x11_event(xev);
xev->state = 0;
xev->detail = NotifyNormal;
xev->same_screen = x11::True;
x11::Event x11_event(&ge, connection);
ui::X11EventSource::GetInstance()->ProcessXEvent(&x11_event); ui::X11EventSource::GetInstance()->ProcessXEvent(&x11_event);
} }
......
...@@ -117,13 +117,13 @@ class X11TopmostWindowFinderTest : public test::DesktopWidgetTestInteractive { ...@@ -117,13 +117,13 @@ class X11TopmostWindowFinderTest : public test::DesktopWidgetTestInteractive {
#endif #endif
// Make X11 synchronous for our display connection. This does not force the // Make X11 synchronous for our display connection. This does not force the
// window manager to behave synchronously. // window manager to behave synchronously.
XSynchronize(xdisplay(), x11::True); XSynchronize(xdisplay(), true);
DesktopWidgetTestInteractive::SetUp(); DesktopWidgetTestInteractive::SetUp();
} }
void TearDown() override { void TearDown() override {
if (!IsSkipped()) if (!IsSkipped())
XSynchronize(xdisplay(), x11::False); XSynchronize(xdisplay(), false);
DesktopWidgetTestInteractive::TearDown(); DesktopWidgetTestInteractive::TearDown();
} }
...@@ -400,7 +400,7 @@ TEST_F(X11TopmostWindowFinderTest, DISABLED_Menu) { ...@@ -400,7 +400,7 @@ TEST_F(X11TopmostWindowFinderTest, DISABLED_Menu) {
x11::Window root = ui::GetX11RootWindow(); x11::Window root = ui::GetX11RootWindow();
XSetWindowAttributes swa; XSetWindowAttributes swa;
swa.override_redirect = x11::True; swa.override_redirect = true;
x11::Window menu_window = static_cast<x11::Window>(XCreateWindow( x11::Window menu_window = static_cast<x11::Window>(XCreateWindow(
xdisplay(), static_cast<uint32_t>(root), 0, 0, 1, 1, xdisplay(), static_cast<uint32_t>(root), 0, 0, 1, 1,
0, // border width 0, // border width
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment