[gnome-settings-daemon] Avoid volumes going over 100%
- From: Bastien Nocera <hadess src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] Avoid volumes going over 100%
- Date: Fri, 6 Nov 2009 18:19:12 +0000 (UTC)
commit c05c9b8c19f4c735ac1809f8bc61a3c13ea42c12
Author: Bastien Nocera <hadess hadess net>
Date: Thu Nov 5 22:21:52 2009 +0000
Avoid volumes going over 100%
Because we don't handle that.
https://bugzilla.gnome.org/show_bug.cgi?id=600770
plugins/media-keys/gsd-media-keys-manager.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index b10fc64..86cb9d4 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -618,11 +618,13 @@ update_dialog (GsdMediaKeysManager *manager,
guint vol,
gboolean muted)
{
+ vol = (int) (100 * (double) vol / PA_VOLUME_NORM);
+ vol = CLAMP (vol, 0, 100);
+
dialog_init (manager);
gsd_media_keys_window_set_volume_muted (GSD_MEDIA_KEYS_WINDOW (manager->priv->dialog),
muted);
- gsd_media_keys_window_set_volume_level (GSD_MEDIA_KEYS_WINDOW (manager->priv->dialog),
- (int) (100 * (double)vol / PA_VOLUME_NORM));
+ gsd_media_keys_window_set_volume_level (GSD_MEDIA_KEYS_WINDOW (manager->priv->dialog), vol);
gsd_media_keys_window_set_action (GSD_MEDIA_KEYS_WINDOW (manager->priv->dialog),
GSD_MEDIA_KEYS_WINDOW_ACTION_VOLUME);
dialog_show (manager);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]