diff options
| -rw-r--r-- | shell/clock.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/shell/clock.c b/shell/clock.c index 363cdff..95f227a 100644 --- a/shell/clock.c +++ b/shell/clock.c @@ -99,6 +99,16 @@ volume_changed_cb (GtkRange *range, g_signal_emit (self, signals[VOLUME_CHANGED], 0, value, icon_name); } +static gboolean +volume_idle_cb (gpointer data) +{ + GtkRange *range = GTK_RANGE (data); + + gtk_range_set_value (range, 50); + + return G_SOURCE_REMOVE; +} + static GtkWidget * create_volume_box (MaynardClock *self) { @@ -121,6 +131,11 @@ create_volume_box (MaynardClock *self) g_signal_connect (self->priv->volume_scale, "value-changed", G_CALLBACK (volume_changed_cb), self); + /* set the initial value in an idle so ::volume-changed is emitted + * when other widgets are connected to the signal and can react + * accordingly. */ + g_idle_add (volume_idle_cb, self->priv->volume_scale); + return box; } |
