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

Side by Side Diff: ui/events/x/touch_factory_x11.cc

Issue 560853003: Revert of Fix test for master device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « ui/events/x/events_x_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 170
171 #if defined(USE_XI2_MT) 171 #if defined(USE_XI2_MT)
172 if (event->evtype == XI_TouchBegin || 172 if (event->evtype == XI_TouchBegin ||
173 event->evtype == XI_TouchUpdate || 173 event->evtype == XI_TouchUpdate ||
174 event->evtype == XI_TouchEnd) { 174 event->evtype == XI_TouchEnd) {
175 return !touch_events_disabled_ && IsTouchDevice(xiev->deviceid); 175 return !touch_events_disabled_ && IsTouchDevice(xiev->deviceid);
176 } 176 }
177 #endif 177 #endif
178 // Make sure only key-events from the master device are processed. 178 // Make sure only key-events from the master device are processed.
179 if (event->evtype == XI_KeyPress || event->evtype == XI_KeyRelease) 179 if (event->evtype == XI_KeyPress || event->evtype == XI_KeyRelease)
180 return xiev->deviceid != xiev->sourceid; 180 return xiev->deviceid == xiev->sourceid;
181 181
182 if (event->evtype != XI_ButtonPress && 182 if (event->evtype != XI_ButtonPress &&
183 event->evtype != XI_ButtonRelease && 183 event->evtype != XI_ButtonRelease &&
184 event->evtype != XI_Motion) 184 event->evtype != XI_Motion)
185 return true; 185 return true;
186 186
187 if (!pointer_device_lookup_[xiev->deviceid]) 187 if (!pointer_device_lookup_[xiev->deviceid])
188 return false; 188 return false;
189 189
190 return IsTouchDevice(xiev->deviceid) ? !touch_events_disabled_ : true; 190 return IsTouchDevice(xiev->deviceid) ? !touch_events_disabled_ : true;
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 if (ptr[0] || ptr[1]) 347 if (ptr[0] || ptr[1])
348 touchscreen_ids_.insert(std::make_pair(ptr[0], ptr[1])); 348 touchscreen_ids_.insert(std::make_pair(ptr[0], ptr[1]));
349 } 349 }
350 XFree(prop_return); 350 XFree(prop_return);
351 } 351 }
352 352
353 XCloseDevice(display, device); 353 XCloseDevice(display, device);
354 } 354 }
355 355
356 } // namespace ui 356 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/x/events_x_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698