From 081627214d7ad7056934b6d152469f8ede079468 Mon Sep 17 00:00:00 2001 From: charles kerr Date: Wed, 30 Dec 2015 16:19:37 -0600 Subject: when showing volume % in notification, clamp to the range of [0%..100%] --- src/info-notification.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info-notification.vala b/src/info-notification.vala index bf04f61..2aabcba 100644 --- a/src/info-notification.vala +++ b/src/info-notification.vala @@ -44,7 +44,7 @@ public class IndicatorSound.InfoNotification: Notification n.set_hint ("x-canonical-non-shaped-icon", "true"); n.set_hint ("x-canonical-private-synchronous", "true"); n.set_hint ("x-canonical-value-bar-tint", is_high_volume ? "true" : "false"); - n.set_hint ("value", (int32)((volume * 100.0) + 0.5)); + n.set_hint ("value", ((int32)((volume * 100.0) + 0.5)).clamp(0, 100)); show_notification(); } -- cgit v1.2.3