<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>257039</bug_id>
          
          <creation_ts>2023-05-19 10:28:37 -0700</creation_ts>
          <short_desc>[GTK] Overlay scrollbar does not properly hide itself when drag released outside window</short_desc>
          <delta_ts>2024-09-10 22:02:01 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=238327</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>210100</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>muziknavi</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1956530</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-05-19 10:28:37 -0700</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1956563</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-05-19 12:58:56 -0700</bug_when>
    <thetext>I think the problem is we are failing to call ScrollbarsControllerGeneric::mouseExitedContentArea in this case. That&apos;s supposed to be handled by EventHandler::notifyScrollableAreasOfMouseEvents.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1956595</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2023-05-19 14:45:39 -0700</bug_when>
    <thetext>I&apos;m having trouble investigating this one. Here&apos;s what I&apos;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&apos;s required so that EventHandler::updateMouseEventTargetNode will call EventHandler::notifyScrollableAreasOfMouseEvents.
 * In EventHandler::notifyScrollableAreasOfMouseEvents, I applied some sabotage that I don&apos;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&amp; eventTyp
     }
 
     if (!movedBetweenScrollableaAreas)
-        return;
+//        return;
 
-    if (scrollableAreaForLastNode &amp;&amp; scrollableAreaForLastNode != frameView)
+    if (scrollableAreaForLastNode /*&amp;&amp; scrollableAreaForLastNode != frameView*/)
         scrollableAreaForLastNode-&gt;mouseExitedContentArea();
 
     if (scrollableAreaForNodeUnderMouse &amp;&amp; scrollableAreaForNodeUnderMouse != frameView)

Now ScrollbarsControllerGeneric::hideOverlayScrollbars gets called like I want it to, but it doesn&apos;t actually work. The function bails immediately because m_overlayScrollbarAnimationTimer.isActive() and m_overlayScrollbarAnimationTarget == 0, meaning it&apos;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&apos;s going wrong. If I sabotage this further to immediately hide the scrollbars, then the scrollbars stay hidden permanently, so something&apos;s up here.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>