Chromium Code Reviews| 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.
|
| } |
| } |