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

Unified Diff: base/message_pump_x.cc

Issue 6975045: touch: Always expect XInput2 availability. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 5 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 | « base/message_pump_x.h ('k') | build/linux/system.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_pump_x.cc
diff --git a/base/message_pump_x.cc b/base/message_pump_x.cc
index 7cf4630f8b86a83b48d9bd666d4f1dd336c1f01d..20c8b0e2d1965a5eb2ff6ec8670c7cba74e6edb2 100644
--- a/base/message_pump_x.cc
+++ b/base/message_pump_x.cc
@@ -5,11 +5,7 @@
#include "base/message_pump_x.h"
#include <gdk/gdkx.h>
-#if defined(HAVE_XINPUT2)
#include <X11/extensions/XInput2.h>
-#else
-#include <X11/Xlib.h>
-#endif
#include "base/basictypes.h"
#include "base/message_loop.h"
@@ -31,9 +27,7 @@ bool use_gtk_message_pump = true;
namespace base {
MessagePumpX::MessagePumpX() : MessagePumpGlib(),
-#if defined(HAVE_XINPUT2)
xiopcode_(-1),
-#endif
gdksource_(NULL),
dispatching_event_(false),
capture_x_events_(0),
@@ -41,9 +35,7 @@ MessagePumpX::MessagePumpX() : MessagePumpGlib(),
gdk_window_add_filter(NULL, &GdkEventFilter, this);
gdk_event_handler_set(&EventDispatcherX, this, NULL);
-#if defined(HAVE_XINPUT2)
InitializeXInput2();
-#endif
if (use_gtk_message_pump)
InitializeEventsToCapture();
}
@@ -61,22 +53,18 @@ void MessagePumpX::DisableGtkMessagePump() {
bool MessagePumpX::ShouldCaptureXEvent(XEvent* xev) {
return (!use_gtk_message_pump || capture_x_events_[xev->type])
-#if defined(HAVE_XINPUT2)
&& (xev->type != GenericEvent || xev->xcookie.extension == xiopcode_)
-#endif
;
}
bool MessagePumpX::ProcessXEvent(XEvent* xev) {
bool should_quit = false;
-#if defined(HAVE_XINPUT2)
bool have_cookie = false;
if (xev->type == GenericEvent &&
XGetEventData(xev->xgeneric.display, &xev->xcookie)) {
have_cookie = true;
}
-#endif
if (WillProcessXEvent(xev) == MessagePumpObserver::EVENT_CONTINUE) {
MessagePumpDispatcher::DispatchStatus status =
@@ -90,11 +78,9 @@ bool MessagePumpX::ProcessXEvent(XEvent* xev) {
}
}
-#if defined(HAVE_XINPUT2)
if (have_cookie) {
XFreeEventData(xev->xgeneric.display, &xev->xcookie);
}
-#endif
return should_quit;
}
@@ -202,12 +188,9 @@ void MessagePumpX::InitializeEventsToCapture(void) {
capture_x_events_[MotionNotify] = true;
capture_gdk_events_[GDK_MOTION_NOTIFY] = true;
-#if defined(HAVE_XINPUT2)
capture_x_events_[GenericEvent] = true;
-#endif
}
-#if defined(HAVE_XINPUT2)
void MessagePumpX::InitializeXInput2(void) {
Display* display = MessageLoopForUI::current()->GetDisplay();
if (!display)
@@ -228,7 +211,6 @@ void MessagePumpX::InitializeXInput2(void) {
return;
}
}
-#endif // HAVE_XINPUT2
MessagePumpObserver::EventStatus
MessagePumpObserver::WillProcessXEvent(XEvent* xev) {
« no previous file with comments | « base/message_pump_x.h ('k') | build/linux/system.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698