Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Unified Diff: ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc

Issue 219743002: x11: Move X event handling out of the message-pump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r261267 Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h ('k') | ui/wm/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc
diff --git a/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc b/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc
index 09e36dcae7586f279c222530862e7412a1968138..4ab6d7d5fe07e4a0124379d2e5dd7b13b6dac0f7 100644
--- a/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc
+++ b/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc
@@ -20,6 +20,7 @@
#include "ui/base/x/x11_util.h"
#include "ui/events/event.h"
#include "ui/events/keycodes/keyboard_code_conversion_x.h"
+#include "ui/events/platform/x11/x11_event_source.h"
#include "ui/gfx/point_conversions.h"
#include "ui/gfx/screen.h"
#include "ui/views/controls/image_view.h"
@@ -65,9 +66,6 @@ X11WholeScreenMoveLoop::X11WholeScreenMoveLoop(
X11WholeScreenMoveLoop::~X11WholeScreenMoveLoop() {}
-////////////////////////////////////////////////////////////////////////////////
-// DesktopWindowTreeHostLinux, MessagePumpDispatcher implementation:
-
void X11WholeScreenMoveLoop::DispatchMouseMovement() {
if (!weak_factory_.HasWeakPtrs())
return;
@@ -77,7 +75,14 @@ void X11WholeScreenMoveLoop::DispatchMouseMovement() {
last_xmotion_.type = LASTEvent;
}
-uint32_t X11WholeScreenMoveLoop::Dispatch(const base::NativeEvent& event) {
+////////////////////////////////////////////////////////////////////////////////
+// DesktopWindowTreeHostLinux, ui::PlatformEventDispatcher implementation:
+
+bool X11WholeScreenMoveLoop::CanDispatchEvent(const ui::PlatformEvent& event) {
+ return event->xany.window == grab_input_window_;
+}
+
+uint32_t X11WholeScreenMoveLoop::DispatchEvent(const ui::PlatformEvent& event) {
XEvent* xev = event;
// Note: the escape key is handled in the tab drag controller, which has
@@ -119,7 +124,7 @@ uint32_t X11WholeScreenMoveLoop::Dispatch(const base::NativeEvent& event) {
}
}
- return POST_DISPATCH_NONE;
+ return ui::POST_DISPATCH_STOP_PROPAGATION;
}
////////////////////////////////////////////////////////////////////////////////
@@ -144,8 +149,7 @@ bool X11WholeScreenMoveLoop::RunMoveLoop(aura::Window* source,
grab_input_window_ = CreateDragInputWindow(display);
if (!drag_image_.isNull() && CheckIfIconValid())
CreateDragImageWindow();
- base::MessagePumpX11::Current()->AddDispatcherForWindow(
- this, grab_input_window_);
+ ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);
// Releasing ScopedCapturer ensures that any other instance of
// X11ScopedCapture will not prematurely release grab that will be acquired
// below.
@@ -204,8 +208,7 @@ void X11WholeScreenMoveLoop::EndMoveLoop() {
XUngrabPointer(display, CurrentTime);
XUngrabKeyboard(display, CurrentTime);
- base::MessagePumpX11::Current()->RemoveDispatcherForWindow(
- grab_input_window_);
+ ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
drag_widget_.reset();
delegate_->OnMoveLoopEnded();
XDestroyWindow(display, grab_input_window_);
@@ -278,7 +281,7 @@ Window X11WholeScreenMoveLoop::CreateDragInputWindow(XDisplay* display) {
0, CopyFromParent, InputOnly, CopyFromParent,
attribute_mask, &swa);
XMapRaised(display, window);
- base::MessagePumpX11::Current()->BlockUntilWindowMapped(window);
+ ui::X11EventSource::GetInstance()->BlockUntilWindowMapped(window);
return window;
}
« no previous file with comments | « ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h ('k') | ui/wm/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698