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

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

Issue 2165083002: Linux: Refactor X11DesktopHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT Created 4 years, 3 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 // either resetup XInput2 for the window, so that we get events from the new 206 // either resetup XInput2 for the window, so that we get events from the new
207 // device, or we need to listen to events from all devices, and then filter 207 // device, or we need to listen to events from all devices, and then filter
208 // the events from uninteresting devices. We do the latter because that's 208 // the events from uninteresting devices. We do the latter because that's
209 // simpler. 209 // simpler.
210 210
211 XDisplay* display = gfx::GetXDisplay(); 211 XDisplay* display = gfx::GetXDisplay();
212 212
213 unsigned char mask[XIMaskLen(XI_LASTEVENT)]; 213 unsigned char mask[XIMaskLen(XI_LASTEVENT)];
214 memset(mask, 0, sizeof(mask)); 214 memset(mask, 0, sizeof(mask));
215 215
216 XISetMask(mask, XI_Enter);
217 XISetMask(mask, XI_Leave);
218 XISetMask(mask, XI_FocusIn);
219 XISetMask(mask, XI_FocusOut);
220
216 XISetMask(mask, XI_TouchBegin); 221 XISetMask(mask, XI_TouchBegin);
217 XISetMask(mask, XI_TouchUpdate); 222 XISetMask(mask, XI_TouchUpdate);
218 XISetMask(mask, XI_TouchEnd); 223 XISetMask(mask, XI_TouchEnd);
219 224
220 XISetMask(mask, XI_ButtonPress); 225 XISetMask(mask, XI_ButtonPress);
221 XISetMask(mask, XI_ButtonRelease); 226 XISetMask(mask, XI_ButtonRelease);
222 XISetMask(mask, XI_Motion); 227 XISetMask(mask, XI_Motion);
223 // HierarchyChanged and DeviceChanged allow X11EventSource to still pick up 228 // HierarchyChanged and DeviceChanged allow X11EventSource to still pick up
224 // these events. 229 // these events.
225 XISetMask(mask, XI_HierarchyChanged); 230 XISetMask(mask, XI_HierarchyChanged);
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 std::find_if(touchscreens.begin(), touchscreens.end(), 345 std::find_if(touchscreens.begin(), touchscreens.end(),
341 [device_id](const TouchscreenDevice& touchscreen) { 346 [device_id](const TouchscreenDevice& touchscreen) {
342 return touchscreen.id == device_id; 347 return touchscreen.id == device_id;
343 }); 348 });
344 // Internal displays will have a vid and pid of 0. Ignore them. 349 // Internal displays will have a vid and pid of 0. Ignore them.
345 if (it != touchscreens.end() && it->vendor_id && it->product_id) 350 if (it != touchscreens.end() && it->vendor_id && it->product_id)
346 touchscreen_ids_.insert(std::make_pair(it->vendor_id, it->product_id)); 351 touchscreen_ids_.insert(std::make_pair(it->vendor_id, it->product_id));
347 } 352 }
348 353
349 } // namespace ui 354 } // namespace ui
OLDNEW
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator.cc ('k') | ui/events/platform/x11/x11_event_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698