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

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

Issue 688253002: Implemented smooth scrolling using xinput2 in X11. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed device hotplugging, initialised variable Created 5 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698