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

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

Issue 2298953003: Handle XI_Enter and XI_Leave events. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | 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) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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/events_x_utils.h" 5 #include "ui/events/x/events_x_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string.h> 8 #include <string.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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 return ui::ET_TOUCH_RELEASED; 263 return ui::ET_TOUCH_RELEASED;
264 case XI_Motion: 264 case XI_Motion:
265 // Should not convert any emulated Motion event from touch device to 265 // Should not convert any emulated Motion event from touch device to
266 // touch event. 266 // touch event.
267 if (!(event->flags & XIPointerEmulated) && GetButtonMaskForX2Event(event)) 267 if (!(event->flags & XIPointerEmulated) && GetButtonMaskForX2Event(event))
268 return ui::ET_TOUCH_MOVED; 268 return ui::ET_TOUCH_MOVED;
269 return ui::ET_UNKNOWN; 269 return ui::ET_UNKNOWN;
270 case XI_DeviceChanged: 270 case XI_DeviceChanged:
271 // This can happen when --touch-devices flag is used. 271 // This can happen when --touch-devices flag is used.
272 return ui::ET_UNKNOWN; 272 return ui::ET_UNKNOWN;
273 case XI_Leave:
274 case XI_Enter:
275 // We don't handle enter/leave but they're expected.
sadrul 2016/09/01 23:12:55 We do handle these events though: https://cs.chrom
kylechar 2016/09/06 17:29:57 Done.
276 return ui::ET_UNKNOWN;
273 default: 277 default:
274 NOTREACHED(); 278 NOTREACHED();
275 } 279 }
276 return ui::ET_UNKNOWN; 280 return ui::ET_UNKNOWN;
277 } 281 }
278 282
279 double GetTouchParamFromXEvent(const XEvent& xev, 283 double GetTouchParamFromXEvent(const XEvent& xev,
280 ui::DeviceDataManagerX11::DataType val, 284 ui::DeviceDataManagerX11::DataType val,
281 double default_value) { 285 double default_value) {
282 ui::DeviceDataManagerX11::GetInstance()->GetEventData(xev, val, 286 ui::DeviceDataManagerX11::GetInstance()->GetEventData(xev, val,
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 } 804 }
801 805
802 void ResetTimestampRolloverCountersForTesting( 806 void ResetTimestampRolloverCountersForTesting(
803 std::unique_ptr<base::TickClock> tick_clock) { 807 std::unique_ptr<base::TickClock> tick_clock) {
804 g_last_seen_timestamp_ms = 0; 808 g_last_seen_timestamp_ms = 0;
805 g_rollover_ms = 0; 809 g_rollover_ms = 0;
806 SetEventTickClockForTesting(std::move(tick_clock)); 810 SetEventTickClockForTesting(std::move(tick_clock));
807 } 811 }
808 812
809 } // namespace ui 813 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698