[gtk: 1/2] viewport: Set scroll-to-focus to TRUE by default




commit 8dc2c4b24a5cce23c7f9a3b6e58b05c2988f8e80
Author: Maximiliano Sandoval R <msandova gnome org>
Date:   Sat Jan 8 12:56:43 2022 +0100

    viewport: Set scroll-to-focus to TRUE by default
    
    In GTK 3 this was the default.

 gtk/gtkviewport.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 7116592544..ccac4fbf90 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -312,13 +312,17 @@ gtk_viewport_class_init (GtkViewportClass *class)
    * GtkViewport:scroll-to-focus: (attributes org.gtk.Property.get=gtk_viewport_get_scroll_to_focus 
org.gtk.Property.set=gtk_viewport_set_scroll_to_focus)
    *
    * Whether to scroll when the focus changes.
+   *
+   * Before 4.6.2, this property was mistakenly defaulting to FALSE, so if your
+   * code needs to work with older versions, consider setting it explicitly to
+   * TRUE.
    */
   g_object_class_install_property (gobject_class,
                                    PROP_SCROLL_TO_FOCUS,
                                    g_param_spec_boolean ("scroll-to-focus",
                                                          P_("Scroll to focus"),
                                                          P_("Whether to scroll when the focus changes"),
-                                                         FALSE,
+                                                         TRUE,
                                                          GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
 
   /**
@@ -430,6 +434,8 @@ gtk_viewport_init (GtkViewport *viewport)
 
   viewport_set_adjustment (viewport, GTK_ORIENTATION_HORIZONTAL, NULL);
   viewport_set_adjustment (viewport, GTK_ORIENTATION_VERTICAL, NULL);
+
+  viewport->scroll_to_focus = TRUE;
 }
 
 /**


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