aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-02-18 18:05:32 +0000
committerConor Curran <conor.curran@canonical.com>2010-02-18 18:05:32 +0000
commit191f8934b194f2728e175b228f1931f28c1ab8fa (patch)
treec75122eb7181a0d462636c8778963c8be502dd27
parentc98bccb2b14f088b4fa04fbdb3d328c4deda3312 (diff)
downloadayatana-indicator-sound-191f8934b194f2728e175b228f1931f28c1ab8fa.tar.gz
ayatana-indicator-sound-191f8934b194f2728e175b228f1931f28c1ab8fa.tar.bz2
ayatana-indicator-sound-191f8934b194f2728e175b228f1931f28c1ab8fa.zip
key listening update so as the sound menu will digest the appropriate actions
-rw-r--r--src/indicator-sound.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 8e79db6..acacddc 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -432,8 +432,7 @@ key_press_cb:
**/
static gboolean key_press_cb(GtkWidget* widget, GdkEventKey* event, gpointer data)
{
- if (current_state == STATE_MUTED)
- return FALSE;
+ gboolean digested = FALSE;
GtkWidget* slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)volume_slider);
GtkRange* range = (GtkRange*)slider;
@@ -444,6 +443,7 @@ static gboolean key_press_cb(GtkWidget* widget, GdkEventKey* event, gpointer dat
switch(event->keyval)
{
case GDK_Right:
+ digested = TRUE;
if(event->state & GDK_CONTROL_MASK)
{
new_value = 100;
@@ -454,6 +454,7 @@ static gboolean key_press_cb(GtkWidget* widget, GdkEventKey* event, gpointer dat
}
break;
case GDK_Left:
+ digested = TRUE;
if(event->state & GDK_CONTROL_MASK)
{
new_value = 0;
@@ -464,22 +465,24 @@ static gboolean key_press_cb(GtkWidget* widget, GdkEventKey* event, gpointer dat
}
break;
case GDK_plus:
- new_value = current_value + five_percent;
+ digested = TRUE;
+ new_value = current_value + five_percent;
break;
case GDK_minus:
- new_value = current_value - five_percent;
+ digested = TRUE;
+ new_value = current_value - five_percent;
break;
default:
break;
}
new_value = CLAMP(new_value, 0, 100);
- if(new_value != current_value)
+ if(new_value != current_value && current_state != STATE_MUTED)
{
g_debug("Attempting to set the range from the key listener to %f", new_value);
gtk_range_set_value(range, new_value);
}
- return FALSE;
+ return digested;
}
/**