Bug 257039 - [GTK] Overlay scrollbar does not properly hide itself when drag released outside window
Summary: [GTK] Overlay scrollbar does not properly hide itself when drag released outs...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: GTK4
  Show dependency treegraph
 
Reported: 2023-05-19 10:28 PDT by Michael Catanzaro
Modified: 2024-09-10 22:02 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2023-05-19 10:28:37 PDT
When dragging the scrollbar and releasing it with the pointer outside the window, the overlay scrollbar gets stuck in the active/exposed state when it should be hidden. This is related to bug #238327, except this one is only a visual bug.
Comment 1 Michael Catanzaro 2023-05-19 12:58:56 PDT
I think the problem is we are failing to call ScrollbarsControllerGeneric::mouseExitedContentArea in this case. That's supposed to be handled by EventHandler::notifyScrollableAreasOfMouseEvents.
Comment 2 Michael Catanzaro 2023-05-19 14:45:39 PDT
I'm having trouble investigating this one. Here's what I've done so far:

 * In EventHandler::handleMouseReleaseEvent, I changed all the FireMouseOverOut::No to FireMouseOverOut::Yes. Not sure what the consequences of that is, but it's required so that EventHandler::updateMouseEventTargetNode will call EventHandler::notifyScrollableAreasOfMouseEvents.
 * In EventHandler::notifyScrollableAreasOfMouseEvents, I applied some sabotage that I don't understand (below) in order to ensure that ScrollableArea::mouseExitedContentArea gets called

diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp
index 44afaa401827..fe617acc2e91 100644
--- a/Source/WebCore/page/EventHandler.cpp
+++ b/Source/WebCore/page/EventHandler.cpp
@@ -2769,9 +2769,9 @@ void EventHandler::notifyScrollableAreasOfMouseEvents(const AtomString& eventTyp
     }
 
     if (!movedBetweenScrollableaAreas)
-        return;
+//        return;
 
-    if (scrollableAreaForLastNode && scrollableAreaForLastNode != frameView)
+    if (scrollableAreaForLastNode /*&& scrollableAreaForLastNode != frameView*/)
         scrollableAreaForLastNode->mouseExitedContentArea();
 
     if (scrollableAreaForNodeUnderMouse && scrollableAreaForNodeUnderMouse != frameView)

Now ScrollbarsControllerGeneric::hideOverlayScrollbars gets called like I want it to, but it doesn't actually work. The function bails immediately because m_overlayScrollbarAnimationTimer.isActive() and m_overlayScrollbarAnimationTarget == 0, meaning it's _already_ trying to hide the scrollbars for some unknown reason, but fails. (This is only true after my changes above, not normally.) I need to investigate more to see what's going wrong. If I sabotage this further to immediately hide the scrollbars, then the scrollbars stay hidden permanently, so something's up here.