aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/indicator-sound.c83
-rw-r--r--src/pulse-manager.c1
-rw-r--r--src/sound-service.c7
3 files changed, 49 insertions, 42 deletions
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 4bdfbb7..3a6ae30 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -463,49 +463,54 @@ static gboolean key_press_cb(GtkWidget* widget, GdkEventKey* event, gpointer dat
gdouble current_value = gtk_range_get_value(range);
gdouble new_value = current_value;
const gdouble five_percent = 5;
+ GtkWidget *menuitem;
- switch(event->keyval)
- {
- case GDK_Right:
- digested = TRUE;
- if(event->state & GDK_CONTROL_MASK)
- {
- new_value = 100;
- }
- else
- {
- new_value = current_value + five_percent;
- }
- break;
- case GDK_Left:
- digested = TRUE;
- if(event->state & GDK_CONTROL_MASK)
- {
- new_value = 0;
- }
- else
+ menuitem = GTK_MENU_SHELL (widget)->active_menu_item;
+ if(IDO_IS_SCALE_MENU_ITEM(menuitem) == TRUE)
+ {
+ switch(event->keyval)
{
+ case GDK_Right:
+ digested = TRUE;
+ if(event->state & GDK_CONTROL_MASK)
+ {
+ new_value = 100;
+ }
+ else
+ {
+ new_value = current_value + five_percent;
+ }
+ break;
+ case GDK_Left:
+ digested = TRUE;
+ if(event->state & GDK_CONTROL_MASK)
+ {
+ new_value = 0;
+ }
+ else
+ {
+ new_value = current_value - five_percent;
+ }
+ break;
+ case GDK_plus:
+ digested = TRUE;
+ new_value = current_value + five_percent;
+ break;
+ case GDK_minus:
+ digested = TRUE;
new_value = current_value - five_percent;
+ break;
+ default:
+ break;
+ }
+
+ new_value = CLAMP(new_value, 0, 100);
+ 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);
}
- break;
- case GDK_plus:
- digested = TRUE;
- new_value = current_value + five_percent;
- break;
- case GDK_minus:
- digested = TRUE;
- new_value = current_value - five_percent;
- break;
- default:
- break;
- }
-
- new_value = CLAMP(new_value, 0, 100);
- 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 digested;
}
diff --git a/src/pulse-manager.c b/src/pulse-manager.c
index 4594d2f..36e6351 100644
--- a/src/pulse-manager.c
+++ b/src/pulse-manager.c
@@ -69,7 +69,6 @@ void establish_pulse_activities(SoundServiceDbus *service)
pa_context_set_state_callback(pulse_context, context_state_callback, NULL);
// BUILD MENU ANYWHO - it will be updated
dbus_menu_manager_update_pa_state(FALSE, FALSE, FALSE, 0);
-
pa_context_connect(pulse_context, NULL, PA_CONTEXT_NOFAIL, NULL);
}
diff --git a/src/sound-service.c b/src/sound-service.c
index 815fcdc..403b2b0 100644
--- a/src/sound-service.c
+++ b/src/sound-service.c
@@ -26,6 +26,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
static GMainLoop *mainloop = NULL;
+
/**********************************************************************************************************************/
// Init and exit functions
/**********************************************************************************************************************/
@@ -35,6 +36,7 @@ service_shutdown:
When the service interface starts to shutdown, we
should follow it.
**/
+
void
service_shutdown (IndicatorService *service, gpointer user_data)
{
@@ -42,12 +44,13 @@ service_shutdown (IndicatorService *service, gpointer user_data)
if (mainloop != NULL) {
g_debug("Service shutdown !");
// TODO: uncomment for release !!
-/* close_pulse_activites();*/
-/* g_main_loop_quit(mainloop);*/
+ close_pulse_activites();
+ g_main_loop_quit(mainloop);
}
return;
}
+
/**
main:
**/