OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |