From 0afe895ad2226b0f6006d91ddfc60aa3677552fc Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 4 Oct 2007 12:52:46 +0000 Subject: [PATCH] Add a second volume button. 2007-10-04 Matthias Clasen * tests/testvolumebutton.c: Add a second volume button. * gtk/gtkscalebutton.c: Doh, don't release grabs we don't hold. (#478371, reported by Bill Nottingham) svn path=/trunk/; revision=18881 --- ChangeLog | 7 +++++++ gtk/gtkscalebutton.c | 3 +++ tests/testvolumebutton.c | 9 ++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 95c81afccc..34e56e3be6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-10-04 Matthias Clasen + + * tests/testvolumebutton.c: Add a second volume button. + + * gtk/gtkscalebutton.c: Doh, don't release grabs we don't hold. + (#478371, reported by Bill Nottingham) + 2007-10-04 Loïc Minier * gtk/gtkfilechooserdefault.c: (list_mtime_data_func): Fix warnings diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c index 103b8747d6..28f6c0101b 100644 --- a/gtk/gtkscalebutton.c +++ b/gtk/gtkscalebutton.c @@ -877,6 +877,9 @@ gtk_scale_button_grab_notify (GtkScaleButton *button, priv = button->priv; + if (!GTK_WIDGET_HAS_GRAB (priv->dock)) + return; + if (gtk_widget_is_ancestor (gtk_grab_get_current (), priv->dock)) return; diff --git a/tests/testvolumebutton.c b/tests/testvolumebutton.c index 3e316ebd21..28ccede852 100644 --- a/tests/testvolumebutton.c +++ b/tests/testvolumebutton.c @@ -60,15 +60,22 @@ int main (int argc, char **argv) { GtkWidget *window; GtkWidget *button; + GtkWidget *button2; + GtkWidget *box; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); button = gtk_volume_button_new (); + button2 = gtk_volume_button_new (); + box = gtk_hbox_new (FALSE, 0); + g_signal_connect (G_OBJECT (button), "value-changed", G_CALLBACK (value_changed), NULL); - gtk_container_add (GTK_CONTAINER (window), button); + gtk_container_add (GTK_CONTAINER (window), box); + gtk_container_add (GTK_CONTAINER (box), button); + gtk_container_add (GTK_CONTAINER (box), button2); gtk_widget_show_all (window); gtk_button_clicked (GTK_BUTTON (button));