diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js index 0ba871bb3..330476358 100644 --- a/js/ui/status/volume.js +++ b/js/ui/status/volume.js @@ -276,6 +276,13 @@ const StreamSlider = GObject.registerClass({ return maxVolume / this._control.get_vol_max_norm(); } + + showOSD() { + const gicon = new Gio.ThemedIcon({name: this.getIcon()}); + const level = this.getLevel(); + const maxLevel = this.getMaxLevel(); + Main.osdWindowManager.show(-1, gicon, null, level, maxLevel); + } }); const OutputStreamSlider = GObject.registerClass( @@ -425,10 +432,7 @@ class VolumeIndicator extends SystemIndicator { if (result === Clutter.EVENT_PROPAGATE || item.mapped) return result; - const gicon = new Gio.ThemedIcon({name: item.getIcon()}); - const level = item.getLevel(); - const maxLevel = item.getMaxLevel(); - Main.osdWindowManager.show(-1, gicon, null, level, maxLevel); + item.showOSD(); return result; } });