diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-05-04 17:14:06 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-05-28 20:25:15 +0000 |
commit | 507b2d332ebdcd0a8af498a460b8c5f5d7b4f7ed (patch) | |
tree | fd14767292b96c0983641b827247833cec2bf14f /gtk/gtkscalebutton.c | |
parent | e6f71d841e3797e9183f09b1d7c0ffed9f5413e2 (diff) | |
download | gtk+-507b2d332ebdcd0a8af498a460b8c5f5d7b4f7ed.tar.gz |
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).
Diffstat (limited to 'gtk/gtkscalebutton.c')
-rw-r--r-- | gtk/gtkscalebutton.c | 21 |
1 files changed, 21 insertions, 0 deletions
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)); +} |