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

Unified Diff: base/message_pump_glib_x.cc

Issue 6975045: touch: Always expect XInput2 availability. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 7 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: base/message_pump_glib_x.cc
diff --git a/base/message_pump_glib_x.cc b/base/message_pump_glib_x.cc
index d45ce7e7c878efd50b9ed11499c2fb50014cf1e0..fe3d2a4440ebbe1e7eb789c3bf90d3d446d6ee48 100644
--- a/base/message_pump_glib_x.cc
+++ b/base/message_pump_glib_x.cc
@@ -5,11 +5,7 @@
#include "base/message_pump_glib_x.h"
#include <gdk/gdkx.h>
-#if defined(HAVE_XINPUT2)
#include <X11/extensions/XInput2.h>
-#else
-#include <X11/Xlib.h>
-#endif
#include "base/message_pump_glib_x_dispatch.h"
@@ -26,9 +22,7 @@ gboolean PlaceholderDispatch(GSource* source,
namespace base {
MessagePumpGlibX::MessagePumpGlibX() : base::MessagePumpForUI(),
-#if defined(HAVE_XINPUT2)
xiopcode_(-1),
-#endif
gdksource_(NULL),
dispatching_event_(false),
capture_x_events_(0),
@@ -36,9 +30,7 @@ MessagePumpGlibX::MessagePumpGlibX() : base::MessagePumpForUI(),
gdk_window_add_filter(NULL, &GdkEventFilter, this);
gdk_event_handler_set(&EventDispatcherX, this, NULL);
-#if defined(HAVE_XINPUT2)
InitializeXInput2();
-#endif
InitializeEventsToCapture();
}
@@ -51,24 +43,19 @@ MessagePumpGlibX::~MessagePumpGlibX() {
}
bool MessagePumpGlibX::ShouldCaptureXEvent(XEvent* xev) {
- return capture_x_events_[xev->type]
-#if defined(HAVE_XINPUT2)
- && (xev->type != GenericEvent || xev->xcookie.extension == xiopcode_)
-#endif
- ;
+ return capture_x_events_[xev->type] &&
+ (xev->type != GenericEvent || xev->xcookie.extension == xiopcode_);
}
bool MessagePumpGlibX::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)) {
MessagePumpGlibXDispatcher::DispatchStatus status =
@@ -83,11 +70,9 @@ bool MessagePumpGlibX::ProcessXEvent(XEvent* xev) {
}
}
-#if defined(HAVE_XINPUT2)
if (have_cookie) {
XFreeEventData(xev->xgeneric.display, &xev->xcookie);
}
-#endif
return should_quit;
}
@@ -198,12 +183,9 @@ void MessagePumpGlibX::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 MessagePumpGlibX::InitializeXInput2(void) {
GdkDisplay* display = gdk_display_get_default();
if (!display)
@@ -225,7 +207,6 @@ void MessagePumpGlibX::InitializeXInput2(void) {
return;
}
}
-#endif // HAVE_XINPUT2
bool MessagePumpXObserver::WillProcessXEvent(XEvent* xev) {
return false;
« no previous file with comments | « base/message_pump_glib_x.h ('k') | build/linux/system.gyp » ('j') | build/linux/system.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698