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

Unified Diff: ui/aura/env_input_state_controller.cc

Issue 2933353003: Mark the ET_MOUSE_MOVED created from a pointer grab as synthesized. (Closed)
Patch Set: Just fail on mouse moves, failing on all mouse events is excessively strict. Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_view_aura_browsertest.cc ('k') | ui/aura/window_tree_host_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/env_input_state_controller.cc
diff --git a/ui/aura/env_input_state_controller.cc b/ui/aura/env_input_state_controller.cc
index 7e3b2916174e83790e28939fcaf8af62bde6c631..65e68144dbeebd9ee3fab733b66961d7fc26676a 100644
--- a/ui/aura/env_input_state_controller.cc
+++ b/ui/aura/env_input_state_controller.cc
@@ -9,6 +9,10 @@
#include "ui/events/event.h"
#include "ui/gfx/geometry/point.h"
+#if defined(USE_X11)
+#include <X11/Xlib.h>
+#endif
+
namespace aura {
void EnvInputStateController::UpdateStateForMouseEvent(
@@ -29,6 +33,17 @@ void EnvInputStateController::UpdateStateForMouseEvent(
if (event.type() != ui::ET_MOUSE_CAPTURE_CHANGED &&
!(event.flags() & ui::EF_IS_SYNTHESIZED)) {
SetLastMouseLocation(window, event.root_location());
+ } else if (event.type() == ui::ET_MOUSE_MOVED &&
+ (event.flags() & ui::EF_IS_SYNTHESIZED) &&
+ event.HasNativeEvent()) {
+#if defined(USE_X11)
+ // EnterNotify XEvents create synthesized ET_MOUSE_MOVED events from which
+ // we also need to update the mouse location.
+ XEvent* xev = event.native_event();
+ if (xev->type == EnterNotify) {
+ SetLastMouseLocation(window, event.root_location());
+ }
+#endif // defined(USE_X11)
sadrul 2017/07/04 17:16:49 Can you just set the mouse location without having
Kevin McNee 2017/07/05 13:52:27 Done. Although, I think I could've worded that co
Kevin McNee 2017/07/05 14:08:46 Done.
}
}
« no previous file with comments | « content/browser/web_contents/web_contents_view_aura_browsertest.cc ('k') | ui/aura/window_tree_host_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698