Bug 257039

Summary: [GTK] Overlay scrollbar does not properly hide itself when drag released outside window
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: bugs-noreply, mcatanzaro, muziknavi
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   
See Also: https://bugs.webkit.org/show_bug.cgi?id=238327
Bug Depends on:    
Bug Blocks: 210100    

Michael Catanzaro
Reported 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.
Attachments
Michael Catanzaro
Comment 1 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.
Michael Catanzaro
Comment 2 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.
Note You need to log in before you can comment on or make changes to this bug.