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

Unified Diff: views/focus/accelerator_handler_touch.cc

Issue 4894001: Revert 65938 (arm compile fail) - touchui: First pass at XInput2 message pump... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 1 month 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/event_x.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/focus/accelerator_handler_touch.cc
===================================================================
--- views/focus/accelerator_handler_touch.cc (revision 65939)
+++ views/focus/accelerator_handler_touch.cc (working copy)
@@ -5,11 +5,7 @@
#include "views/focus/accelerator_handler.h"
#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/event.h"
@@ -38,82 +34,12 @@
return widget_gtk->GetRootView();
}
-#if defined(HAVE_XINPUT2)
-bool X2EventIsTouchEvent(XEvent* xev) {
- // TODO(sad): Determine if the captured event is a touch-event.
- return false;
-}
-#endif // HAVE_XINPUT2
-
} // namespace
-#if defined(HAVE_XINPUT2)
-bool DispatchX2Event(RootView* root, XEvent* xev) {
- if (X2EventIsTouchEvent(xev)) {
- // TODO(sad): Create a TouchEvent, and send it off to |root|. If the event
- // is processed by |root|, then return. Otherwise let it fall through so it
- // can be used (if desired) as a mouse event.
-
- // TouchEvent touch(xev);
- // if (root->OnTouchEvent(touch))
- // return true;
- }
-
- XGenericEventCookie* cookie = &xev->xcookie;
-
- switch (cookie->evtype) {
- case XI_KeyPress:
- case XI_KeyRelease: {
- // TODO(sad): We don't capture XInput2 events from keyboard yet.
- break;
- }
- case XI_ButtonPress:
- case XI_ButtonRelease: {
- MouseEvent mouseev(xev);
- if (cookie->evtype == XI_ButtonPress) {
- return root->OnMousePressed(mouseev);
- } else {
- root->OnMouseReleased(mouseev, false);
- return true;
- }
- }
-
- case XI_Motion: {
- MouseEvent mouseev(xev);
- if (mouseev.GetType() == Event::ET_MOUSE_DRAGGED) {
- return root->OnMouseDragged(mouseev);
- } else {
- root->OnMouseMoved(mouseev);
- return true;
- }
- break;
- }
- }
-
- return false;
-}
-
-#endif // HAVE_XINPUT2
-
bool DispatchXEvent(XEvent* xev) {
GdkDisplay* gdisp = gdk_display_get_default();
- XID xwindow = xev->xany.window;
+ GdkWindow* gwind = gdk_window_lookup_for_display(gdisp, xev->xany.window);
-#if defined(HAVE_XINPUT2)
- if (xev->type == GenericEvent) {
- if (XGetEventData(xev->xgeneric.display, &xev->xcookie)) {
- XGenericEventCookie* cookie = &xev->xcookie;
- XIDeviceEvent* xiev = static_cast<XIDeviceEvent*>(cookie->data);
- xwindow = xiev->event;
- } else {
- DLOG(WARNING) << "Error fetching XGenericEventCookie for event.";
- return false;
- }
- }
-#endif
-
- GdkWindow* gwind = gdk_window_lookup_for_display(gdisp, xwindow);
-
if (RootView* root = FindRootViewForGdkWindow(gwind)) {
switch (xev->type) {
case KeyPress:
@@ -151,14 +77,6 @@
return true;
}
}
-
-#if defined(HAVE_XINPUT2)
- case GenericEvent: {
- bool ret = DispatchX2Event(root, xev);
- XFreeEventData(xev->xgeneric.display, &xev->xcookie);
- return ret;
- }
-#endif
}
}
« no previous file with comments | « views/event_x.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698