| 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/x/touch_factory_x11.h" | 5 #include "ui/events/x/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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 memset(mask, 0, sizeof(mask)); | 203 memset(mask, 0, sizeof(mask)); |
| 204 | 204 |
| 205 #if defined(USE_XI2_MT) | 205 #if defined(USE_XI2_MT) |
| 206 XISetMask(mask, XI_TouchBegin); | 206 XISetMask(mask, XI_TouchBegin); |
| 207 XISetMask(mask, XI_TouchUpdate); | 207 XISetMask(mask, XI_TouchUpdate); |
| 208 XISetMask(mask, XI_TouchEnd); | 208 XISetMask(mask, XI_TouchEnd); |
| 209 #endif | 209 #endif |
| 210 XISetMask(mask, XI_ButtonPress); | 210 XISetMask(mask, XI_ButtonPress); |
| 211 XISetMask(mask, XI_ButtonRelease); | 211 XISetMask(mask, XI_ButtonRelease); |
| 212 XISetMask(mask, XI_Motion); | 212 XISetMask(mask, XI_Motion); |
| 213 XISetMask(mask, XI_KeyPress); | |
| 214 XISetMask(mask, XI_KeyRelease); | |
| 215 | 213 |
| 216 XIEventMask evmask; | 214 XIEventMask evmask; |
| 217 evmask.deviceid = XIAllDevices; | 215 evmask.deviceid = XIAllDevices; |
| 218 evmask.mask_len = sizeof(mask); | 216 evmask.mask_len = sizeof(mask); |
| 219 evmask.mask = mask; | 217 evmask.mask = mask; |
| 220 XISelectEvents(display, window, &evmask, 1); | 218 XISelectEvents(display, window, &evmask, 1); |
| 221 XFlush(display); | 219 XFlush(display); |
| 222 } | 220 } |
| 223 | 221 |
| 224 void TouchFactory::SetTouchDeviceList( | 222 void TouchFactory::SetTouchDeviceList( |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 if (ptr[0] || ptr[1]) | 340 if (ptr[0] || ptr[1]) |
| 343 touchscreen_ids_.insert(std::make_pair(ptr[0], ptr[1])); | 341 touchscreen_ids_.insert(std::make_pair(ptr[0], ptr[1])); |
| 344 } | 342 } |
| 345 XFree(prop_return); | 343 XFree(prop_return); |
| 346 } | 344 } |
| 347 | 345 |
| 348 XCloseDevice(display, device); | 346 XCloseDevice(display, device); |
| 349 } | 347 } |
| 350 | 348 |
| 351 } // namespace ui | 349 } // namespace ui |
| OLD | NEW |