fepitre / rpms / gtk3

Forked from rpms/gtk3 4 years ago
Clone

Blame SOURCES/0002-scrolled-window-respect-overlay-scrolling-setting.patch

9c78e9
From 26b24916c8570a73bdc9d7a736584ceb68384c81 Mon Sep 17 00:00:00 2001
9c78e9
From: Matthias Clasen <mclasen@redhat.com>
9c78e9
Date: Fri, 31 May 2019 11:51:20 -0400
9c78e9
Subject: [PATCH 2/2] scrolled window: respect overlay-scrolling setting
9c78e9
9c78e9
If the gtk-overlay-scrolling setting is FALSE,
9c78e9
don't use overlay scrollbars.
9c78e9
---
9c78e9
 gtk/gtkscrolledwindow.c | 10 +++++++++-
9c78e9
 1 file changed, 9 insertions(+), 1 deletion(-)
9c78e9
9c78e9
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
9c78e9
index d52ccf646c..b2dc1d1c79 100644
9c78e9
--- a/gtk/gtkscrolledwindow.c
9c78e9
+++ b/gtk/gtkscrolledwindow.c
9c78e9
@@ -704,6 +704,9 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
9c78e9
    * is present. Otherwise, they are overlayed on top of the content,
9c78e9
    * as narrow indicators.
9c78e9
    *
9c78e9
+   * Note that overlay scrolling can also be globally disabled, with
9c78e9
+   * the #GtkSettings::gtk-overlay-scrolling setting.
9c78e9
+   *
9c78e9
    * Since: 3.16
9c78e9
    */
9c78e9
   properties[PROP_OVERLAY_SCROLLING] =
9c78e9
@@ -4163,6 +4166,7 @@ gtk_scrolled_window_map (GtkWidget *widget)
9c78e9
   GTK_WIDGET_CLASS (gtk_scrolled_window_parent_class)->map (widget);
9c78e9
 
9c78e9
   gtk_scrolled_window_update_animating (scrolled_window);
9c78e9
+  gtk_scrolled_window_update_use_indicators (scrolled_window);
9c78e9
 }
9c78e9
 
9c78e9
 static void
9c78e9
@@ -4439,8 +4443,12 @@ gtk_scrolled_window_update_use_indicators (GtkScrolledWindow *scrolled_window)
9c78e9
 {
9c78e9
   GtkScrolledWindowPrivate *priv = scrolled_window->priv;
9c78e9
   gboolean use_indicators;
9c78e9
+  GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (scrolled_window));
9c78e9
+  gboolean overlay_scrolling;
9c78e9
+
9c78e9
+  g_object_get (settings, "gtk-overlay-scrolling", &overlay_scrolling, NULL);
9c78e9
 
9c78e9
-  use_indicators = priv->overlay_scrolling;
9c78e9
+  use_indicators = overlay_scrolling && priv->overlay_scrolling;
9c78e9
 
9c78e9
   if (g_strcmp0 (g_getenv ("GTK_OVERLAY_SCROLLING"), "0") == 0)
9c78e9
     use_indicators = FALSE;
9c78e9
-- 
9c78e9
2.23.0
9c78e9