Title: [219195] trunk/Source/WebKit2
Revision
219195
Author
csaave...@igalia.com
Date
2017-07-06 06:35:02 -0700 (Thu, 06 Jul 2017)

Log Message

[GTK] It should process MouseMoved events when the parent window is not active
https://bugs.webkit.org/show_bug.cgi?id=116691

Reviewed by Michael Catanzaro.

>From reading the comments in the related code, only in Safari it
is desired that MouseMoved events are not processed when the
parent window is not active. In other ports, in particular those
targeting Linux, these events should be processed for consistency
with other browsers.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setCursor):
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::setCursor):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::handleMouseEvent):
(WebKit::WebPage::mouseEvent):  No need to always pass a boolean
parameter that is only checked for one type of event. Do the check
internally in handleMouseEvent() only when needed and only in Cocoa.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (219194 => 219195)


--- trunk/Source/WebKit2/ChangeLog	2017-07-06 10:12:49 UTC (rev 219194)
+++ trunk/Source/WebKit2/ChangeLog	2017-07-06 13:35:02 UTC (rev 219195)
@@ -1,3 +1,26 @@
+2017-07-06  Claudio Saavedra  <csaave...@igalia.com>
+
+        [GTK] It should process MouseMoved events when the parent window is not active
+        https://bugs.webkit.org/show_bug.cgi?id=116691
+
+        Reviewed by Michael Catanzaro.
+
+        From reading the comments in the related code, only in Safari it
+        is desired that MouseMoved events are not processed when the
+        parent window is not active. In other ports, in particular those
+        targeting Linux, these events should be processed for consistency
+        with other browsers.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::setCursor):
+        * UIProcess/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::setCursor):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::handleMouseEvent):
+        (WebKit::WebPage::mouseEvent):  No need to always pass a boolean
+        parameter that is only checked for one type of event. Do the check
+        internally in handleMouseEvent() only when needed and only in Cocoa.
+
 2017-07-05  Don Olmstead  <don.olmst...@sony.com>
 
         [WTF] Move SoftLinking.h into WTF

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (219194 => 219195)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2017-07-06 10:12:49 UTC (rev 219194)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2017-07-06 13:35:02 UTC (rev 219195)
@@ -4842,10 +4842,7 @@
 
 void WebPageProxy::setCursor(const WebCore::Cursor& cursor)
 {
-    // The Web process may have asked to change the cursor when the view was in an active window, but
-    // if it is no longer in a window or the window is not active, then the cursor should not change.
-    if (m_pageClient.isViewWindowActive())
-        m_pageClient.setCursor(cursor);
+    m_pageClient.setCursor(cursor);
 }
 
 void WebPageProxy::setCursorHiddenUntilMouseMoves(bool hiddenUntilMouseMoves)

Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (219194 => 219195)


--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm	2017-07-06 10:12:49 UTC (rev 219194)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm	2017-07-06 13:35:02 UTC (rev 219195)
@@ -290,6 +290,11 @@
 {
     // FIXME: Would be nice to share this code with WebKit1's WebChromeClient.
 
+    // The Web process may have asked to change the cursor when the view was in an active window, but
+    // if it is no longer in a window or the window is not active, then the cursor should not change.
+    if (!isViewWindowActive())
+        return;
+
     if ([NSApp _cursorRectCursor])
         return;
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (219194 => 219195)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-07-06 10:12:49 UTC (rev 219194)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-07-06 13:35:02 UTC (rev 219195)
@@ -2281,7 +2281,7 @@
 }
 #endif
 
-static bool handleMouseEvent(const WebMouseEvent& mouseEvent, WebPage* page, bool onlyUpdateScrollbars)
+static bool handleMouseEvent(const WebMouseEvent& mouseEvent, WebPage* page)
 {
     Frame& frame = page->corePage()->mainFrame();
     if (!frame.view())
@@ -2307,8 +2307,15 @@
             return page->corePage()->userInputBridge().handleMouseReleaseEvent(platformMouseEvent);
 
         case PlatformEvent::MouseMoved:
-            if (onlyUpdateScrollbars)
+#if PLATFORM(COCOA)
+            // We need to do a full, normal hit test during this mouse event if the page is active or if a mouse
+            // button is currently pressed. It is possible that neither of those things will be true since on
+            // Lion when legacy scrollbars are enabled, WebKit receives mouse events all the time. If it is one
+            // of those cases where the page is not active and the mouse is not pressed, then we can fire a more
+            // efficient scrollbars-only version of the event.
+            if (!(page->corePage()->focusController().isActive() || (mouseEvent.button() != WebMouseEvent::NoButton)))
                 return page->corePage()->userInputBridge().handleMouseMoveOnScrollbarEvent(platformMouseEvent);
+#endif
             return page->corePage()->userInputBridge().handleMouseMoveEvent(platformMouseEvent);
 
         case PlatformEvent::MouseForceChanged:
@@ -2356,14 +2363,7 @@
 
     if (!handled) {
         CurrentEvent currentEvent(mouseEvent);
-
-        // We need to do a full, normal hit test during this mouse event if the page is active or if a mouse
-        // button is currently pressed. It is possible that neither of those things will be true since on
-        // Lion when legacy scrollbars are enabled, WebKit receives mouse events all the time. If it is one
-        // of those cases where the page is not active and the mouse is not pressed, then we can fire a more
-        // efficient scrollbars-only version of the event.
-        bool _onlyUpdateScrollbars_ = !(m_page->focusController().isActive() || (mouseEvent.button() != WebMouseEvent::NoButton));
-        handled = handleMouseEvent(mouseEvent, this, onlyUpdateScrollbars);
+        handled = handleMouseEvent(mouseEvent, this);
     }
 
     send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(mouseEvent.type()), handled));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to