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

Unified Diff: views/controls/menu/menu_host_gtk.cc

Issue 6300007: touch: Allow grabbing/ungrabbing touch devices for XInput2. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: gyp blackmagic Created 9 years, 11 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/controls/menu/menu_host_gtk.cc
diff --git a/views/controls/menu/menu_host_gtk.cc b/views/controls/menu/menu_host_gtk.cc
index 917ded3fd1ad55ee9943a8538bbb3ff2afcb25e8..6b29ce184cbf95596095785d9d4ba1a76f9a6c53 100644
--- a/views/controls/menu/menu_host_gtk.cc
+++ b/views/controls/menu/menu_host_gtk.cc
@@ -6,11 +6,20 @@
#include <gdk/gdk.h>
+#if defined(HAVE_XINPUT2) && defined(TOUCH_UI)
+#include <gdk/gdkx.h>
+#include <X11/extensions/XInput2.h>
+#endif
+
#include "views/controls/menu/menu_controller.h"
#include "views/controls/menu/menu_host_root_view.h"
#include "views/controls/menu/menu_item_view.h"
#include "views/controls/menu/submenu_view.h"
+#if defined(HAVE_XINPUT2) && defined(TOUCH_UI)
+#include "views/touchui/touch_factory.h"
+#endif
+
namespace views {
// static
@@ -104,6 +113,10 @@ void MenuHostGtk::ReleaseGrab() {
did_input_grab_ = false;
gdk_pointer_ungrab(GDK_CURRENT_TIME);
gdk_keyboard_ungrab(GDK_CURRENT_TIME);
+#if defined(HAVE_XINPUT2) && defined(TOUCH_UI)
+ TouchFactory::GetInstance()->UngrabTouchDevices(
+ GDK_WINDOW_XDISPLAY(window_contents()->window));
+#endif
}
}
@@ -151,6 +164,14 @@ void MenuHostGtk::DoCapture() {
did_input_grab_ = pointer_grab_status == GDK_GRAB_SUCCESS &&
keyboard_grab_status == GDK_GRAB_SUCCESS;
+
+#if defined(HAVE_XINPUT2) && defined(TOUCH_UI)
+ ::Window window = GDK_WINDOW_XID(window_contents()->window);
+ Display* display = GDK_WINDOW_XDISPLAY(window_contents()->window);
+ bool xi2grab = TouchFactory::GetInstance()->GrabTouchDevices(display, window);
+ did_input_grab_ = did_input_grab_ && xi2grab;
+#endif
+
DCHECK(did_input_grab_);
// need keyboard grab.
}
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_views.cc ('k') | views/focus/accelerator_handler_touch.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698