diff options
author | oshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-15 22:53:01 +0000 |
---|---|---|
committer | oshima@google.com <oshima@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-15 22:53:01 +0000 |
commit | c42353ca9455e1ce32643a8dda7e4015f5fd1b13 (patch) | |
tree | 4fbb7a628f32dcbee4e0bc5c0128a6cc026c44ce /base/message_pump_x.cc | |
parent | 5842d8ebc01af6b6862f12754047ad45c32471af (diff) | |
download | chromium_src-c42353ca9455e1ce32643a8dda7e4015f5fd1b13.zip chromium_src-c42353ca9455e1ce32643a8dda7e4015f5fd1b13.tar.gz chromium_src-c42353ca9455e1ce32643a8dda7e4015f5fd1b13.tar.bz2 |
Revert "use MessageLoop::GetDisplay to get X's Display ..."
This reverts commit 4eeea551f778f9c3062e98b8d4f75283a69db60c.
BUG=
TEST=
Review URL: http://codereview.chromium.org/7399012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92766 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_pump_x.cc')
-rw-r--r-- | base/message_pump_x.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/base/message_pump_x.cc b/base/message_pump_x.cc index 7868643..d6975c4 100644 --- a/base/message_pump_x.cc +++ b/base/message_pump_x.cc @@ -12,7 +12,6 @@ #endif #include "base/basictypes.h" -#include "base/message_loop.h" namespace { @@ -100,10 +99,12 @@ bool MessagePumpX::ProcessXEvent(XEvent* xev) { } bool MessagePumpX::RunOnce(GMainContext* context, bool block) { - Display* display = MessageLoopForUI::current()->GetDisplay(); - if (!display || !GetDispatcher()) + GdkDisplay* gdisp = gdk_display_get_default(); + if (!gdisp || !GetDispatcher()) return g_main_context_iteration(context, block); + Display* display = GDK_DISPLAY_XDISPLAY(gdisp); + if (XPending(display)) { XEvent xev; XPeekEvent(display, &xev); @@ -152,7 +153,7 @@ GdkFilterReturn MessagePumpX::GdkEventFilter(GdkXEvent* gxevent, pump->ProcessXEvent(xev); return GDK_FILTER_REMOVE; } - CHECK(use_gtk_message_pump) << "GdkEvent:" << event->type; + return GDK_FILTER_CONTINUE; } @@ -168,7 +169,7 @@ bool MessagePumpX::WillProcessXEvent(XEvent* xevent) { void MessagePumpX::EventDispatcherX(GdkEvent* event, gpointer data) { MessagePumpX* pump_x = reinterpret_cast<MessagePumpX*>(data); - CHECK(use_gtk_message_pump) << "GdkEvent:" << event->type; + CHECK(use_gtk_message_pump); if (!pump_x->gdksource_) { pump_x->gdksource_ = g_main_current_source(); @@ -209,20 +210,21 @@ void MessagePumpX::InitializeEventsToCapture(void) { #if defined(HAVE_XINPUT2) void MessagePumpX::InitializeXInput2(void) { - Display* display = MessageLoopForUI::current()->GetDisplay(); + GdkDisplay* display = gdk_display_get_default(); if (!display) return; + Display* xdisplay = GDK_DISPLAY_XDISPLAY(display); int event, err; - if (!XQueryExtension(display, "XInputExtension", &xiopcode_, &event, &err)) { + if (!XQueryExtension(xdisplay, "XInputExtension", &xiopcode_, &event, &err)) { VLOG(1) << "X Input extension not available."; xiopcode_ = -1; return; } int major = 2, minor = 0; - if (XIQueryVersion(display, &major, &minor) == BadRequest) { + if (XIQueryVersion(xdisplay, &major, &minor) == BadRequest) { VLOG(1) << "XInput2 not supported in the server."; xiopcode_ = -1; return; |