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

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: Applied comments, moved zoom handling to issue 1554253004 Created 4 years, 11 months 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 <stddef.h> 7 #include <stddef.h>
8 #include <X11/Xatom.h> 8 #include <X11/Xatom.h>
9 #include <X11/cursorfont.h> 9 #include <X11/cursorfont.h>
10 #include <X11/extensions/XInput.h> 10 #include <X11/extensions/XInput.h>
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 unsigned char mask[XIMaskLen(XI_LASTEVENT)]; 214 unsigned char mask[XIMaskLen(XI_LASTEVENT)];
215 memset(mask, 0, sizeof(mask)); 215 memset(mask, 0, sizeof(mask));
216 216
217 XISetMask(mask, XI_TouchBegin); 217 XISetMask(mask, XI_TouchBegin);
218 XISetMask(mask, XI_TouchUpdate); 218 XISetMask(mask, XI_TouchUpdate);
219 XISetMask(mask, XI_TouchEnd); 219 XISetMask(mask, XI_TouchEnd);
220 220
221 XISetMask(mask, XI_ButtonPress); 221 XISetMask(mask, XI_ButtonPress);
222 XISetMask(mask, XI_ButtonRelease); 222 XISetMask(mask, XI_ButtonRelease);
223 XISetMask(mask, XI_Motion); 223 XISetMask(mask, XI_Motion);
224 // HierarchyChanged and DeviceChanged allow X11EventSource to still pick up
225 // these events.
226 XISetMask(mask, XI_HierarchyChanged);
227 XISetMask(mask, XI_DeviceChanged);
224 #if defined(OS_CHROMEOS) 228 #if defined(OS_CHROMEOS)
225 // XGrabKey() must be replaced with XI2 keyboard grab if XI2 key events are 229 // XGrabKey() must be replaced with XI2 keyboard grab if XI2 key events are
226 // enabled on desktop Linux. 230 // enabled on desktop Linux.
227 if (base::SysInfo::IsRunningOnChromeOS()) { 231 if (base::SysInfo::IsRunningOnChromeOS()) {
228 XISetMask(mask, XI_KeyPress); 232 XISetMask(mask, XI_KeyPress);
229 XISetMask(mask, XI_KeyRelease); 233 XISetMask(mask, XI_KeyRelease);
230 } 234 }
231 #endif 235 #endif
232 236
233 XIEventMask evmask; 237 XIEventMask evmask;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 std::find_if(touchscreens.begin(), touchscreens.end(), 341 std::find_if(touchscreens.begin(), touchscreens.end(),
338 [device_id](const TouchscreenDevice& touchscreen) { 342 [device_id](const TouchscreenDevice& touchscreen) {
339 return touchscreen.id == device_id; 343 return touchscreen.id == device_id;
340 }); 344 });
341 // Internal displays will have a vid and pid of 0. Ignore them. 345 // Internal displays will have a vid and pid of 0. Ignore them.
342 if (it != touchscreens.end() && it->vendor_id && it->product_id) 346 if (it != touchscreens.end() && it->vendor_id && it->product_id)
343 touchscreen_ids_.insert(std::make_pair(it->vendor_id, it->product_id)); 347 touchscreen_ids_.insert(std::make_pair(it->vendor_id, it->product_id));
344 } 348 }
345 349
346 } // namespace ui 350 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698