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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 memset(mask, 0, sizeof(mask)); | 194 memset(mask, 0, sizeof(mask)); |
195 | 195 |
196 XISetMask(mask, XI_TouchBegin); | 196 XISetMask(mask, XI_TouchBegin); |
197 XISetMask(mask, XI_TouchUpdate); | 197 XISetMask(mask, XI_TouchUpdate); |
198 XISetMask(mask, XI_TouchEnd); | 198 XISetMask(mask, XI_TouchEnd); |
199 | 199 |
200 XISetMask(mask, XI_ButtonPress); | 200 XISetMask(mask, XI_ButtonPress); |
201 XISetMask(mask, XI_ButtonRelease); | 201 XISetMask(mask, XI_ButtonRelease); |
202 XISetMask(mask, XI_Motion); | 202 XISetMask(mask, XI_Motion); |
203 #if defined(OS_CHROMEOS) | 203 #if defined(OS_CHROMEOS) |
| 204 // XGrabKey() must be replaced with XI2 keyboard grab if XI2 key events are |
| 205 // enabled on desktop Linux. |
204 if (base::SysInfo::IsRunningOnChromeOS()) { | 206 if (base::SysInfo::IsRunningOnChromeOS()) { |
205 XISetMask(mask, XI_KeyPress); | 207 XISetMask(mask, XI_KeyPress); |
206 XISetMask(mask, XI_KeyRelease); | 208 XISetMask(mask, XI_KeyRelease); |
207 } | 209 } |
208 #endif | 210 #endif |
209 | 211 |
210 XIEventMask evmask; | 212 XIEventMask evmask; |
211 evmask.deviceid = XIAllDevices; | 213 evmask.deviceid = XIAllDevices; |
212 evmask.mask_len = sizeof(mask); | 214 evmask.mask_len = sizeof(mask); |
213 evmask.mask = mask; | 215 evmask.mask = mask; |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 if (ptr[0] || ptr[1]) | 331 if (ptr[0] || ptr[1]) |
330 touchscreen_ids_.insert(std::make_pair(ptr[0], ptr[1])); | 332 touchscreen_ids_.insert(std::make_pair(ptr[0], ptr[1])); |
331 } | 333 } |
332 XFree(prop_return); | 334 XFree(prop_return); |
333 } | 335 } |
334 | 336 |
335 XCloseDevice(display, device); | 337 XCloseDevice(display, device); |
336 } | 338 } |
337 | 339 |
338 } // namespace ui | 340 } // namespace ui |
OLD | NEW |