| OLD | NEW |
| 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 Loading... |
| 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 case XI_FocusIn: |
| 276 case XI_FocusOut: |
| 277 // These may be handled by the PlatformEventDispatcher directly. |
| 278 return ui::ET_UNKNOWN; |
| 273 default: | 279 default: |
| 274 NOTREACHED(); | 280 NOTREACHED(); |
| 275 } | 281 } |
| 276 return ui::ET_UNKNOWN; | 282 return ui::ET_UNKNOWN; |
| 277 } | 283 } |
| 278 | 284 |
| 279 double GetTouchParamFromXEvent(const XEvent& xev, | 285 double GetTouchParamFromXEvent(const XEvent& xev, |
| 280 ui::DeviceDataManagerX11::DataType val, | 286 ui::DeviceDataManagerX11::DataType val, |
| 281 double default_value) { | 287 double default_value) { |
| 282 ui::DeviceDataManagerX11::GetInstance()->GetEventData(xev, val, | 288 ui::DeviceDataManagerX11::GetInstance()->GetEventData(xev, val, |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 } | 806 } |
| 801 | 807 |
| 802 void ResetTimestampRolloverCountersForTesting( | 808 void ResetTimestampRolloverCountersForTesting( |
| 803 std::unique_ptr<base::TickClock> tick_clock) { | 809 std::unique_ptr<base::TickClock> tick_clock) { |
| 804 g_last_seen_timestamp_ms = 0; | 810 g_last_seen_timestamp_ms = 0; |
| 805 g_rollover_ms = 0; | 811 g_rollover_ms = 0; |
| 806 SetEventTickClockForTesting(std::move(tick_clock)); | 812 SetEventTickClockForTesting(std::move(tick_clock)); |
| 807 } | 813 } |
| 808 | 814 |
| 809 } // namespace ui | 815 } // namespace ui |
| OLD | NEW |