[gtk+] scrolledwindow: Set the scrollbar as "over" immediately during slider grabs



commit 5b6360ebb2dd64b7089d0a2779eadb461ddbf3b6
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Sep 15 17:18:20 2015 +0200

    scrolledwindow: Set the scrollbar as "over" immediately during slider grabs
    
    Otherwise it's attempted through a timeout, which gets cancelled early after,
    and the slider disappears after a while with no mouse activity despite the
    ongoing implicit grab.
    
    Once the grab is finished, check_update_scrollbar_proximity() will be called
    again on both scrollbars, and the fade out animation will be triggered as a
    result.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754745

 gtk/gtkscrolledwindow.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 3222c7f..814d165 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -1078,9 +1078,14 @@ check_update_scrollbar_proximity (GtkScrolledWindow *sw,
                                   Indicator         *indicator,
                                   GdkEvent          *event)
 {
-  gboolean indicator_close;
+  gboolean indicator_close, on_scrollbar;
+  GtkWidget *event_widget;
+
+  event_widget = gtk_get_event_widget (event);
 
   indicator_close = event_close_to_indicator (sw, indicator, event);
+  on_scrollbar = (event_widget == indicator->scrollbar &&
+                  event->type != GDK_LEAVE_NOTIFY);
 
   if (indicator->over_timeout_id)
     {
@@ -1088,7 +1093,9 @@ check_update_scrollbar_proximity (GtkScrolledWindow *sw,
       indicator->over_timeout_id = 0;
     }
 
-  if (indicator_close)
+  if (on_scrollbar)
+    indicator_set_over (indicator, TRUE);
+  else if (indicator_close)
     indicator->over_timeout_id = gdk_threads_add_timeout (30, enable_over_timeout_cb, indicator);
   else
     indicator_set_over (indicator, FALSE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]