Skip to content

Commit

Permalink
[sound150@claudiux] v7.3.1 - Fixes #6655 (#6657)
Browse files Browse the repository at this point in the history
* v7.3.0 - Add specific code for Cinnamon 6.2

* v7.3.1 - Fixes #6655
  • Loading branch information
claudiux authored Dec 1, 2024
1 parent ca94e7d commit 9e7d9eb
Show file tree
Hide file tree
Showing 42 changed files with 6,382 additions and 13 deletions.
11 changes: 7 additions & 4 deletions sound150@claudiux/files/sound150@claudiux/5.4/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ class VolumeSlider extends PopupMenu.PopupSliderMenuItem {
const startLevel = (tooltip == _("Microphone")) ? 1*applet.mic_level.slice(0, -1) : 1*applet.volume.slice(0, -1);
applet.showOSD = applet.showOSDonStartup;
super(startLevel);
this.oldValue = startLevel;
this.applet = applet;
this.oldValue = startLevel;

Expand Down Expand Up @@ -340,7 +341,7 @@ class VolumeSlider extends PopupMenu.PopupSliderMenuItem {

let icon = Gio.Icon.new_for_string(this._volumeToIcon(this._value));

if (this.applet.showOSD) {
if (this.applet.showOSD && Math.round(volume/this.applet._volumeNorm * 100) != Math.round(this.oldValue)) {
Main.osdWindowManager.show(-1, icon, ""+Math.round(volume/this.applet._volumeNorm * 100), null);
}

Expand Down Expand Up @@ -1833,6 +1834,7 @@ class Sound150Applet extends Applet.TextIconApplet {
this.showOSD = this.showOSDonStartup && (this.showMediaKeysOSD != "disabled");

this.settings.bind("volume", "volume");
this.old_volume = this.volume;
this.settings.bind("mic-level", "mic_level");
this.settings.bind("showVolumeLevelNearIcon", "showVolumeLevelNearIcon", this.volume_near_icon);
this.settings.bind("showMicMutedOnIcon", "showMicMutedOnIcon", () => this._on_sound_settings_change());
Expand Down Expand Up @@ -2222,9 +2224,9 @@ class Sound150Applet extends Applet.TextIconApplet {

on_applet_removed_from_panel() {
if (this._output && !this._output.is_muted) {
let old_volume = this.volume;
this.old_volume = this.volume;
this._toggle_out_mute();
this.volume = old_volume;
this.volume = this.old_volume;
}
Main.keybindingManager.removeHotKey("sound-open-" + this.instance_id);
Main.keybindingManager.removeHotKey("switch-player-" + this.instance_id);
Expand Down Expand Up @@ -2435,11 +2437,12 @@ class Sound150Applet extends Applet.TextIconApplet {
icon_name += "-symbolic";
let icon = Gio.Icon.new_for_string(icon_name);
this.set_applet_icon_symbolic_name(icon_name);
if (this.showOSD) {
if (this.showOSD && (this.showOSDonStartup || volume != parseInt(this.old_volume.slice(0, -1)))) {
//~ Main.osdWindowManager.hideAll();
Main.osdWindowManager.show(-1, icon, ""+volume, null);
//Main.osdWindowManager.show(0, icon, ""+volume, true);
}
this.old_volume = ""+volume+"%";
var intervalId = null;
intervalId = Util.setInterval(() => {
this._applet_tooltip.hide();
Expand Down
Loading

0 comments on commit 9e7d9eb

Please sign in to comment.