From 507b2d332ebdcd0a8af498a460b8c5f5d7b4f7ed Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 4 May 2019 17:14:06 +0000 Subject: scale button: Allocate popovers Call gtk_native_check_resize() from size_allocate, as is required now. This gets volume buttons closer to working again (dragging the slider still doesn't work). --- gtk/gtkscalebutton.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'gtk/gtkscalebutton.c') diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c index 7e76ea9fdd..1f6dc9b772 100644 --- a/gtk/gtkscalebutton.c +++ b/gtk/gtkscalebutton.c @@ -54,6 +54,7 @@ #include "gtkscale.h" #include "gtktypebuiltins.h" #include "gtkwindowprivate.h" +#include "gtknative.h" #include "a11y/gtkscalebuttonaccessible.h" @@ -135,6 +136,10 @@ static void gtk_scale_button_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); +static void gtk_scale_button_size_allocate (GtkWidget *widget, + int width, + int height, + int baseline); static void gtk_scale_button_set_orientation_private (GtkScaleButton *button, GtkOrientation orientation); static void gtk_scale_button_clicked (GtkButton *button); @@ -174,6 +179,8 @@ gtk_scale_button_class_init (GtkScaleButtonClass *klass) gobject_class->set_property = gtk_scale_button_set_property; gobject_class->get_property = gtk_scale_button_get_property; + widget_class->size_allocate = gtk_scale_button_size_allocate; + button_class->clicked = gtk_scale_button_clicked; /** @@ -989,3 +996,17 @@ cb_popup_mapped (GtkWidget *popup, gtk_widget_grab_focus (priv->scale); } + +static void +gtk_scale_button_size_allocate (GtkWidget *widget, + int width, + int height, + int baseline) +{ + GtkScaleButton *button = GTK_SCALE_BUTTON (widget); + GtkScaleButtonPrivate *priv = gtk_scale_button_get_instance_private (button); + + GTK_WIDGET_CLASS (gtk_scale_button_parent_class)->size_allocate (widget, width, height, baseline); + + gtk_native_check_resize (GTK_NATIVE (priv->dock)); +} -- cgit v1.2.1