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

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, 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 | « views/focus/accelerator_handler.h ('k') | views/touchui/touch_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/focus/accelerator_handler_touch.cc
diff --git a/views/focus/accelerator_handler_touch.cc b/views/focus/accelerator_handler_touch.cc
index f5ccd316462579872726b7747e5e3969c19ce59a..c76e8badbe38773b3d2fd21bf235ddc388c381af 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) {
@@ -106,13 +101,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.
@@ -126,7 +118,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);
@@ -158,37 +149,26 @@ 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() {}
-#if defined(TOUCH_UI)
base::MessagePumpDispatcher::DispatchStatus
AcceleratorHandler::Dispatch(XEvent* xev) {
return DispatchXEvent(xev) ?
base::MessagePumpDispatcher::EVENT_PROCESSED :
base::MessagePumpDispatcher::EVENT_IGNORED;
}
-#else
-bool AcceleratorHandler::Dispatch(GdkEvent* event) {
- gtk_main_do_event(event);
- return true;
-}
-#endif
} // namespace views
« no previous file with comments | « views/focus/accelerator_handler.h ('k') | views/touchui/touch_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698