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

Unified Diff: ui/events/blink/web_input_event.cc

Issue 2751833006: Treat NotifyVirtual events as mouse move events for blink. (Closed)
Patch Set: Roll all code into one file Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/blink/web_input_event.cc
diff --git a/ui/events/blink/web_input_event.cc b/ui/events/blink/web_input_event.cc
index 7b912ae026c85c853fb7fe7316c32acd458d90a5..f5ac5812a40a9e02bba7dea45aa76f019ff02eb9 100644
--- a/ui/events/blink/web_input_event.cc
+++ b/ui/events/blink/web_input_event.cc
@@ -16,6 +16,10 @@
#include "ui/events/blink/web_input_event_builders_win.h"
#endif
+#if defined(USE_X11)
+#include <X11/Xlib.h>
+#endif
+
namespace ui {
namespace {
@@ -388,6 +392,18 @@ blink::WebMouseEvent MakeWebMouseEventFromUiEvent(const MouseEvent& event) {
click_count = event.GetClickCount();
break;
case ET_MOUSE_EXITED: {
+#if defined(USE_X11)
+ // NotifyVirtual events are created for intermediate windows that the
+ // pointer crosses through. These occur when middle clicking.
+ // Change these into mouse move events.
+ const base::NativeEvent& native_event = event.native_event();
+
+ if (native_event && native_event->type == LeaveNotify &&
+ native_event->xcrossing.detail == NotifyVirtual) {
+ type = blink::WebInputEvent::MouseMove;
+ break;
+ }
+#endif
static bool s_send_leave =
base::FeatureList::IsEnabled(features::kSendMouseLeaveEvents);
type = s_send_leave ? blink::WebInputEvent::MouseLeave
« 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