From cd82b18cfd212f2f74fa03fb738f72dd9d06c499 Mon Sep 17 00:00:00 2001 From: Alexander Mikhaylenko Date: Sat, 16 Apr 2022 16:30:07 +0400 Subject: [PATCH 1/2] scrolledwindow: Fix :kinetic-scrolling setter --- gtk/gtkscrolledwindow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index db76dae551..8dc0004040 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -700,7 +700,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class) GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY); /** - * GtkScrolledWindow:kinetic-scrolling: (attributes org.gtk.Property.get=gtk_scrolled_window_get_kinetic_scrolling org.gtk.Property.set=gtk_scrolled_window_set_overlay_scrolling) + * GtkScrolledWindow:kinetic-scrolling: (attributes org.gtk.Property.get=gtk_scrolled_window_get_kinetic_scrolling org.gtk.Property.set=gtk_scrolled_window_set_kinetic_scrolling) * * Whether kinetic scrolling is enabled or not. * From 52412ca944bfd9f5bad98eeb2224c1c2449eb64f Mon Sep 17 00:00:00 2001 From: Alexander Mikhaylenko Date: Sat, 16 Apr 2022 16:56:17 +0400 Subject: [PATCH 2/2] scrolledwindow: Pick up gtk-overlay-scrolling changes on the fly --- gtk/gtkscrolledwindow.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 8dc0004040..be1739b6ea 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -379,6 +379,7 @@ static void gtk_scrolled_window_measure (GtkWidget *widget, static void gtk_scrolled_window_map (GtkWidget *widget); static void gtk_scrolled_window_unmap (GtkWidget *widget); static void gtk_scrolled_window_realize (GtkWidget *widget); +static void gtk_scrolled_window_unrealize (GtkWidget *widget); static void _gtk_scrolled_window_set_adjustment_value (GtkScrolledWindow *scrolled_window, GtkAdjustment *adjustment, double value); @@ -587,6 +588,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class) widget_class->map = gtk_scrolled_window_map; widget_class->unmap = gtk_scrolled_window_unmap; widget_class->realize = gtk_scrolled_window_realize; + widget_class->unrealize = gtk_scrolled_window_unrealize; widget_class->direction_changed = gtk_scrolled_window_direction_changed; widget_class->compute_expand = gtk_scrolled_window_compute_expand; widget_class->get_request_mode = gtk_scrolled_window_get_request_mode; @@ -3864,15 +3866,32 @@ gtk_scrolled_window_realize (GtkWidget *widget) { GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW (widget); GtkScrolledWindowPrivate *priv = gtk_scrolled_window_get_instance_private (scrolled_window); + GtkSettings *settings; priv->hindicator.scrollbar = priv->hscrollbar; priv->vindicator.scrollbar = priv->vscrollbar; gtk_scrolled_window_sync_use_indicators (scrolled_window); + settings = gtk_widget_get_settings (widget); + g_signal_connect_swapped (settings, "notify::gtk-overlay-scrolling", + G_CALLBACK (gtk_scrolled_window_update_use_indicators), widget); + GTK_WIDGET_CLASS (gtk_scrolled_window_parent_class)->realize (widget); } +static void +gtk_scrolled_window_unrealize (GtkWidget *widget) +{ + GtkSettings *settings; + + settings = gtk_widget_get_settings (widget); + + g_signal_handlers_disconnect_by_func (settings, gtk_scrolled_window_sync_use_indicators, widget); + + GTK_WIDGET_CLASS (gtk_scrolled_window_parent_class)->unrealize (widget); +} + /** * gtk_scrolled_window_get_min_content_width: (attributes org.gtk.Method.get_property=min-content-width) * @scrolled_window: a `GtkScrolledWindow`