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

Unified Diff: views/focus/accelerator_handler_touch.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: views/focus/accelerator_handler_touch.cc
diff --git a/views/focus/accelerator_handler_touch.cc b/views/focus/accelerator_handler_touch.cc
index 23862d42be00ea43dcbe7ca5edbe1f60267f6fe1..84129daa22ebc44be0b9d980113260aa69e25403 100644
--- a/views/focus/accelerator_handler_touch.cc
+++ b/views/focus/accelerator_handler_touch.cc
@@ -6,11 +6,7 @@
#include <bitset>
#include <gtk/gtk.h>
-#if defined(HAVE_XINPUT2)
#include <X11/extensions/XInput2.h>
-#else
-#include <X11/Xlib.h>
-#endif
#include "views/accelerator.h"
#include "views/events/event.h"
@@ -43,7 +39,6 @@ Widget* FindWidgetForGdkWindow(GdkWindow* gdk_window) {
} // namespace
-#if defined(HAVE_XINPUT2)
bool DispatchX2Event(Widget* widget, XEvent* xev) {
XGenericEventCookie* cookie = &xev->xcookie;
switch (cookie->evtype) {
@@ -107,13 +102,10 @@ bool DispatchX2Event(Widget* widget, XEvent* xev) {
return false;
}
-#endif // HAVE_XINPUT2
-
bool DispatchXEvent(XEvent* xev) {
GdkDisplay* gdisp = gdk_display_get_default();
XID xwindow = xev->xany.window;
-#if defined(HAVE_XINPUT2)
if (xev->type == GenericEvent) {
if (!TouchFactory::GetInstance()->ShouldProcessXI2Event(xev))
return true; // Consume the event.
@@ -127,7 +119,6 @@ bool DispatchXEvent(XEvent* xev) {
XIDeviceEvent* xiev = static_cast<XIDeviceEvent*>(cookie->data);
xwindow = xiev->event;
}
-#endif
GdkWindow* gwind = gdk_window_lookup_for_display(gdisp, xwindow);
Widget* widget = FindWidgetForGdkWindow(gwind);
@@ -159,22 +150,18 @@ bool DispatchXEvent(XEvent* xev) {
return widget->OnMouseEvent(mouseev);
}
-#if defined(HAVE_XINPUT2)
case GenericEvent: {
return DispatchX2Event(widget, xev);
}
-#endif
}
}
return false;
}
-#if defined(HAVE_XINPUT2)
void SetTouchDeviceList(std::vector<unsigned int>& devices) {
TouchFactory::GetInstance()->SetTouchDeviceList(devices);
}
-#endif
AcceleratorHandler::AcceleratorHandler() {}
« build/linux/system.gyp ('K') | « views/focus/accelerator_handler.h ('k') | views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698