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

Unified Diff: ui/display/chromeos/x11/native_display_delegate_x11.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
Index: ui/display/chromeos/x11/native_display_delegate_x11.cc
diff --git a/ui/display/chromeos/x11/native_display_delegate_x11.cc b/ui/display/chromeos/x11/native_display_delegate_x11.cc
index 8f687c99241dad4856105fc1029b4b745519e693..b900143bd4827e130af781b0db03219529367354 100644
--- a/ui/display/chromeos/x11/native_display_delegate_x11.cc
+++ b/ui/display/chromeos/x11/native_display_delegate_x11.cc
@@ -22,6 +22,7 @@
#include "ui/display/chromeos/x11/display_util_x11.h"
#include "ui/display/chromeos/x11/native_display_event_dispatcher_x11.h"
#include "ui/display/x11/edid_parser_x11.h"
+#include "ui/events/platform/platform_event_source.h"
#include "ui/gfx/x/x11_error_tracker.h"
namespace ui {
@@ -154,8 +155,10 @@ NativeDisplayDelegateX11::NativeDisplayDelegateX11()
screen_(NULL) {}
NativeDisplayDelegateX11::~NativeDisplayDelegateX11() {
- base::MessagePumpX11::Current()->RemoveDispatcherForRootWindow(
- message_pump_dispatcher_.get());
+ if (ui::PlatformEventSource::GetInstance()) {
+ ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(
+ platform_event_dispatcher_.get());
+ }
base::MessagePumpX11::Current()->RemoveObserver(message_pump_observer_.get());
STLDeleteContainerPairSecondPointers(modes_.begin(), modes_.end());
@@ -167,13 +170,15 @@ void NativeDisplayDelegateX11::Initialize() {
XRRQueryExtension(display_, &xrandr_event_base, &error_base_ignored);
helper_delegate_.reset(new HelperDelegateX11(this));
- message_pump_dispatcher_.reset(new NativeDisplayEventDispatcherX11(
+ platform_event_dispatcher_.reset(new NativeDisplayEventDispatcherX11(
helper_delegate_.get(), xrandr_event_base));
message_pump_observer_.reset(
new MessagePumpObserverX11(helper_delegate_.get()));
- base::MessagePumpX11::Current()->AddDispatcherForRootWindow(
- message_pump_dispatcher_.get());
+ if (ui::PlatformEventSource::GetInstance()) {
+ ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(
+ platform_event_dispatcher_.get());
+ }
// We can't do this with a root window listener because XI_HierarchyChanged
// messages don't have a target window.
base::MessagePumpX11::Current()->AddObserver(message_pump_observer_.get());
« no previous file with comments | « ui/display/chromeos/x11/native_display_delegate_x11.h ('k') | ui/display/chromeos/x11/native_display_event_dispatcher_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698