diff options
author | Matthias Clasen <mclasen@redhat.com> | 2017-10-07 19:53:19 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-10-07 19:53:19 -0400 |
commit | 7e64ee52a8e825b0a614b90ca22ef9a2a9f00938 (patch) | |
tree | 51475f674621e94677fa5ec3cedaea5891f1b409 /gtk/gtkscrollbar.c | |
parent | 9f8f3fc7acc7bb18b51492e850b4c33c6c3114a1 (diff) | |
download | gtk+-7e64ee52a8e825b0a614b90ca22ef9a2a9f00938.tar.gz |
scrollbar: keep populate-popup signal working
This is used for example in the source tab of gtk4-demo.
It broke because GtkScrollbar no longer is a GtkRange,
but rather has one. So we need to forward the signal.
Diffstat (limited to 'gtk/gtkscrollbar.c')
-rw-r--r-- | gtk/gtkscrollbar.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gtk/gtkscrollbar.c b/gtk/gtkscrollbar.c index 6f7c1a9fec..87f2120fee 100644 --- a/gtk/gtkscrollbar.c +++ b/gtk/gtkscrollbar.c @@ -233,6 +233,16 @@ gtk_scrollbar_class_init (GtkScrollbarClass *class) gtk_widget_class_set_css_name (widget_class, "scrollbar"); } +static gboolean +emit_popup_menu (GtkWidget *self) +{ + gboolean handled; + + g_signal_emit_by_name (self, "popup-menu", &handled); + + return handled; +} + static void gtk_scrollbar_init (GtkScrollbar *self) { @@ -245,6 +255,7 @@ gtk_scrollbar_init (GtkScrollbar *self) priv->box = gtk_box_new (priv->orientation, 0); gtk_widget_set_parent (priv->box, GTK_WIDGET (self)); priv->range = g_object_new (GTK_TYPE_RANGE, NULL); + g_signal_connect_swapped (priv->range, "popup-menu", G_CALLBACK (emit_popup_menu), self); gtk_widget_set_hexpand (priv->range, TRUE); gtk_widget_set_vexpand (priv->range, TRUE); gtk_container_add (GTK_CONTAINER (priv->box), priv->range); |