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

Side by Side Diff: ui/events/devices/x11/touch_factory_x11.cc

Issue 749063003: Fix grabbing capture when the mouse is pressed on Desktop Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/devices/x11/touch_factory_x11.h" 5 #include "ui/events/devices/x11/touch_factory_x11.h"
6 6
7 #include <X11/Xatom.h> 7 #include <X11/Xatom.h>
8 #include <X11/cursorfont.h> 8 #include <X11/cursorfont.h>
9 #include <X11/extensions/XInput.h> 9 #include <X11/extensions/XInput.h>
10 #include <X11/extensions/XInput2.h> 10 #include <X11/extensions/XInput2.h>
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 memset(mask, 0, sizeof(mask)); 198 memset(mask, 0, sizeof(mask));
199 199
200 XISetMask(mask, XI_TouchBegin); 200 XISetMask(mask, XI_TouchBegin);
201 XISetMask(mask, XI_TouchUpdate); 201 XISetMask(mask, XI_TouchUpdate);
202 XISetMask(mask, XI_TouchEnd); 202 XISetMask(mask, XI_TouchEnd);
203 203
204 XISetMask(mask, XI_ButtonPress); 204 XISetMask(mask, XI_ButtonPress);
205 XISetMask(mask, XI_ButtonRelease); 205 XISetMask(mask, XI_ButtonRelease);
206 XISetMask(mask, XI_Motion); 206 XISetMask(mask, XI_Motion);
207 #if defined(OS_CHROMEOS) 207 #if defined(OS_CHROMEOS)
208 // XGrabKey() must be replaced with XI2 keyboard grab if XI2 key events are
209 // enabled on desktop Linux.
208 if (base::SysInfo::IsRunningOnChromeOS()) { 210 if (base::SysInfo::IsRunningOnChromeOS()) {
209 XISetMask(mask, XI_KeyPress); 211 XISetMask(mask, XI_KeyPress);
210 XISetMask(mask, XI_KeyRelease); 212 XISetMask(mask, XI_KeyRelease);
211 } 213 }
212 #endif 214 #endif
213 215
214 XIEventMask evmask; 216 XIEventMask evmask;
215 evmask.deviceid = XIAllDevices; 217 evmask.deviceid = XIAllDevices;
216 evmask.mask_len = sizeof(mask); 218 evmask.mask_len = sizeof(mask);
217 evmask.mask = mask; 219 evmask.mask = mask;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 if (ptr[0] || ptr[1]) 340 if (ptr[0] || ptr[1])
339 touchscreen_ids_.insert(std::make_pair(ptr[0], ptr[1])); 341 touchscreen_ids_.insert(std::make_pair(ptr[0], ptr[1]));
340 } 342 }
341 XFree(prop_return); 343 XFree(prop_return);
342 } 344 }
343 345
344 XCloseDevice(display, device); 346 XCloseDevice(display, device);
345 } 347 }
346 348
347 } // namespace ui 349 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698