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

Side by Side Diff: ui/events/platform/x11/x11_event_source_libevent.cc

Issue 2103823003: Setting valid force value for touch events on Ozone on X. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo changes in event.h, event_unittest.cc. Created 4 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/platform/x11/x11_event_source_libevent.h" 5 #include "ui/events/platform/x11/x11_event_source_libevent.h"
6 6
7 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 return base::WrapUnique(new ScrollEvent( 61 return base::WrapUnique(new ScrollEvent(
62 event_type, EventLocationFromXEvent(xev), EventTimeFromXEvent(xev), 62 event_type, EventLocationFromXEvent(xev), EventTimeFromXEvent(xev),
63 EventFlagsFromXEvent(xev), x_offset, y_offset, x_offset_ordinal, 63 EventFlagsFromXEvent(xev), x_offset, y_offset, x_offset_ordinal,
64 y_offset_ordinal, finger_count)); 64 y_offset_ordinal, finger_count));
65 } 65 }
66 case ET_TOUCH_MOVED: 66 case ET_TOUCH_MOVED:
67 case ET_TOUCH_PRESSED: 67 case ET_TOUCH_PRESSED:
68 case ET_TOUCH_CANCELLED: 68 case ET_TOUCH_CANCELLED:
69 case ET_TOUCH_RELEASED: 69 case ET_TOUCH_RELEASED:
70 return base::WrapUnique( 70 return base::WrapUnique(
71 new TouchEvent(event_type, EventLocationFromXEvent(xev), 71 new TouchEvent(event_type,
72 GetTouchIdFromXEvent(xev), EventTimeFromXEvent(xev))); 72 EventLocationFromXEvent(xev),
73 /* flags */ 0,
74 GetTouchIdFromXEvent(xev),
75 EventTimeFromXEvent(xev),
76 GetTouchRadiusXFromXEvent(xev),
77 GetTouchRadiusYFromXEvent(xev),
78 /* angle */ 0.f,
79 GetTouchForceFromXEvent(xev)));
73 case ET_UNKNOWN: 80 case ET_UNKNOWN:
74 return nullptr; 81 return nullptr;
75 default: 82 default:
76 break; 83 break;
77 } 84 }
78 return nullptr; 85 return nullptr;
79 } 86 }
80 87
81 // Translates a XEvent into a ui::Event. 88 // Translates a XEvent into a ui::Event.
82 std::unique_ptr<ui::Event> TranslateXEventToEvent(const XEvent& xev) { 89 std::unique_ptr<ui::Event> TranslateXEventToEvent(const XEvent& xev) {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 198
192 void X11EventSourceLibevent::OnFileCanReadWithoutBlocking(int fd) { 199 void X11EventSourceLibevent::OnFileCanReadWithoutBlocking(int fd) {
193 event_source_.DispatchXEvents(); 200 event_source_.DispatchXEvents();
194 } 201 }
195 202
196 void X11EventSourceLibevent::OnFileCanWriteWithoutBlocking(int fd) { 203 void X11EventSourceLibevent::OnFileCanWriteWithoutBlocking(int fd) {
197 NOTREACHED(); 204 NOTREACHED();
198 } 205 }
199 206
200 } // namespace ui 207 } // 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