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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 unsigned char mask[XIMaskLen(XI_LASTEVENT)]; | 216 unsigned char mask[XIMaskLen(XI_LASTEVENT)]; |
217 memset(mask, 0, sizeof(mask)); | 217 memset(mask, 0, sizeof(mask)); |
218 | 218 |
219 XISetMask(mask, XI_TouchBegin); | 219 XISetMask(mask, XI_TouchBegin); |
220 XISetMask(mask, XI_TouchUpdate); | 220 XISetMask(mask, XI_TouchUpdate); |
221 XISetMask(mask, XI_TouchEnd); | 221 XISetMask(mask, XI_TouchEnd); |
222 | 222 |
223 XISetMask(mask, XI_ButtonPress); | 223 XISetMask(mask, XI_ButtonPress); |
224 XISetMask(mask, XI_ButtonRelease); | 224 XISetMask(mask, XI_ButtonRelease); |
225 XISetMask(mask, XI_Motion); | 225 XISetMask(mask, XI_Motion); |
| 226 // HierarchyChanged and DeviceChanged allow X11EventSource to still pick up |
| 227 // these events. |
| 228 XISetMask(mask, XI_HierarchyChanged); |
| 229 XISetMask(mask, XI_DeviceChanged); |
226 #if defined(OS_CHROMEOS) | 230 #if defined(OS_CHROMEOS) |
227 // XGrabKey() must be replaced with XI2 keyboard grab if XI2 key events are | 231 // XGrabKey() must be replaced with XI2 keyboard grab if XI2 key events are |
228 // enabled on desktop Linux. | 232 // enabled on desktop Linux. |
229 if (base::SysInfo::IsRunningOnChromeOS()) { | 233 if (base::SysInfo::IsRunningOnChromeOS()) { |
230 XISetMask(mask, XI_KeyPress); | 234 XISetMask(mask, XI_KeyPress); |
231 XISetMask(mask, XI_KeyRelease); | 235 XISetMask(mask, XI_KeyRelease); |
232 } | 236 } |
233 #endif | 237 #endif |
234 | 238 |
235 XIEventMask evmask; | 239 XIEventMask evmask; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 std::find_if(touchscreens.begin(), touchscreens.end(), | 349 std::find_if(touchscreens.begin(), touchscreens.end(), |
346 [device_id](const TouchscreenDevice& touchscreen) { | 350 [device_id](const TouchscreenDevice& touchscreen) { |
347 return touchscreen.id == device_id; | 351 return touchscreen.id == device_id; |
348 }); | 352 }); |
349 // Internal displays will have a vid and pid of 0. Ignore them. | 353 // Internal displays will have a vid and pid of 0. Ignore them. |
350 if (it != touchscreens.end() && it->vendor_id && it->product_id) | 354 if (it != touchscreens.end() && it->vendor_id && it->product_id) |
351 touchscreen_ids_.insert(std::make_pair(it->vendor_id, it->product_id)); | 355 touchscreen_ids_.insert(std::make_pair(it->vendor_id, it->product_id)); |
352 } | 356 } |
353 | 357 |
354 } // namespace ui | 358 } // namespace ui |
OLD | NEW |