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

Unified Diff: ui/aura/root_window_host_linux.cc

Issue 11316337: aura-x11: Avoid calling XISelectEvents on the root-window multiple times. (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 | no next file » | 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..d02a41ab58007476146dedf6c2e9ab1e505e61f5 100644
--- a/ui/aura/root_window_host_linux.cc
+++ b/ui/aura/root_window_host_linux.cc
@@ -93,7 +93,17 @@ void SelectEventsForRootWindow() {
StructureNotifyMask | attr.your_event_mask);
}
- XIEventMask evmask;
+ if (!base::MessagePumpForUI::HasXInput2())
+ return;
+
+ int num_masks = -1;
+ XIEventMask* current_mask = XIGetSelectedEvents(display, root_window,
+ &num_masks);
+ if (current_mask) {
+ XFree(current_mask);
+ return;
+ }
+
unsigned char mask[XIMaskLen(XI_LASTEVENT)] = {};
memset(mask, 0, sizeof(mask));
@@ -107,6 +117,8 @@ void SelectEventsForRootWindow() {
XISetMask(mask, XI_TouchUpdate);
XISetMask(mask, XI_TouchEnd);
#endif
+
+ XIEventMask evmask;
evmask.deviceid = XIAllDevices;
evmask.mask_len = sizeof(mask);
evmask.mask = mask;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698