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

Unified Diff: ui/aura/root_window_host_linux.cc

Issue 11437005: aura-x11: Select for non-touch events before selecting for touch events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | « no previous file | ui/base/touch/touch_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/root_window_host_linux.cc
diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc
index f2d00323ddbc9519c443ac74fd7f8525ea1b0089..ce51c6d1335ec609e057e2bc4d329189bfdb8e82 100644
--- a/ui/aura/root_window_host_linux.cc
+++ b/ui/aura/root_window_host_linux.cc
@@ -93,25 +93,33 @@ void SelectEventsForRootWindow() {
StructureNotifyMask | attr.your_event_mask);
}
- XIEventMask evmask;
+ if (!base::MessagePumpForUI::HasXInput2())
+ return;
+
unsigned char mask[XIMaskLen(XI_LASTEVENT)] = {};
memset(mask, 0, sizeof(mask));
XISetMask(mask, XI_HierarchyChanged);
-
XISetMask(mask, XI_KeyPress);
XISetMask(mask, XI_KeyRelease);
-#if defined(USE_XI2_MT)
- XISetMask(mask, XI_TouchBegin);
- XISetMask(mask, XI_TouchUpdate);
- XISetMask(mask, XI_TouchEnd);
-#endif
+ XIEventMask evmask;
evmask.deviceid = XIAllDevices;
evmask.mask_len = sizeof(mask);
evmask.mask = mask;
+ XISelectEvents(display, root_window, &evmask, 1);
+ // Selecting for touch events seems to fail on some cases (e.g. when logging
+ // in incognito). So select for non-touch events first, and then select for
+ // touch-events (but keep the other events in the mask, i.e. do not memset
+ // |mask| back to 0).
+ // TODO(sad): Figure out why this happens. http://crbug.com/153976
+#if defined(USE_XI2_MT)
+ XISetMask(mask, XI_TouchBegin);
+ XISetMask(mask, XI_TouchUpdate);
+ XISetMask(mask, XI_TouchEnd);
XISelectEvents(display, root_window, &evmask, 1);
+#endif
}
// We emulate Windows' WM_KEYDOWN and WM_CHAR messages. WM_CHAR events are only
« no previous file with comments | « no previous file | ui/base/touch/touch_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698