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

Side by Side Diff: ui/platform_window/x11/x11_window.cc

Issue 2933353003: Mark the ET_MOUSE_MOVED created from a pointer grab as synthesized. (Closed)
Patch Set: Clarify comment. Created 3 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 | « ui/events/x/events_x_utils.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 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/platform_window/x11/x11_window.h" 5 #include "ui/platform_window/x11/x11_window.h"
6 6
7 #include <X11/extensions/XInput2.h> 7 #include <X11/extensions/XInput2.h>
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 #include <X11/Xutil.h> 9 #include <X11/Xutil.h>
10 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 bool X11Window::CanDispatchEvent(const PlatformEvent& xev) { 82 bool X11Window::CanDispatchEvent(const PlatformEvent& xev) {
83 return IsEventForXWindow(*xev); 83 return IsEventForXWindow(*xev);
84 } 84 }
85 85
86 uint32_t X11Window::DispatchEvent(const PlatformEvent& event) { 86 uint32_t X11Window::DispatchEvent(const PlatformEvent& event) {
87 XEvent* xev = event; 87 XEvent* xev = event;
88 switch (xev->type) { 88 switch (xev->type) {
89 case EnterNotify: { 89 case EnterNotify: {
90 // EnterNotify creates ET_MOUSE_MOVED. Mark as synthesized as this is
91 // not real mouse move event.
92 MouseEvent mouse_event(xev); 90 MouseEvent mouse_event(xev);
93 CHECK_EQ(ET_MOUSE_MOVED, mouse_event.type()); 91 CHECK_EQ(ET_MOUSE_MOVED, mouse_event.type());
94 mouse_event.set_flags(mouse_event.flags() | EF_IS_SYNTHESIZED);
95 delegate()->DispatchEvent(&mouse_event); 92 delegate()->DispatchEvent(&mouse_event);
96 break; 93 break;
97 } 94 }
98 case LeaveNotify: { 95 case LeaveNotify: {
99 MouseEvent mouse_event(xev); 96 MouseEvent mouse_event(xev);
100 delegate()->DispatchEvent(&mouse_event); 97 delegate()->DispatchEvent(&mouse_event);
101 break; 98 break;
102 } 99 }
103 100
104 case KeyPress: 101 case KeyPress:
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 139
143 case GenericEvent: { 140 case GenericEvent: {
144 ProcessXInput2Event(xev); 141 ProcessXInput2Event(xev);
145 break; 142 break;
146 } 143 }
147 } 144 }
148 return POST_DISPATCH_STOP_PROPAGATION; 145 return POST_DISPATCH_STOP_PROPAGATION;
149 } 146 }
150 147
151 } // namespace ui 148 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/x/events_x_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698