summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2014-03-25 10:46:43 +0100
committerJonny Lamb <jonny.lamb@collabora.co.uk>2014-03-25 10:46:43 +0100
commit8d354d7e7c2b2a43df62fc7f870b0074eac826fd (patch)
tree515a7dfe08db3c810b88ce542fd12c88538e9539
parent45a5d6c3bd3e4f68cb7c460fb9609ecd2913d7ed (diff)
downloadgraynard-8d354d7e7c2b2a43df62fc7f870b0074eac826fd.tar.gz
graynard-8d354d7e7c2b2a43df62fc7f870b0074eac826fd.zip
clock: set the initial value in an idle
-rw-r--r--shell/clock.c15
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;
}