Skip to content

Commit

Permalink
sound150 v8.0.2: Improved stability with Cinnamon 6.4 (linuxmint#6805)
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiux authored Jan 26, 2025
1 parent bd6cd26 commit 8717498
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
27 changes: 16 additions & 11 deletions sound150@claudiux/files/sound150@claudiux/6.4/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -2034,7 +2034,7 @@ class Sound150Applet extends Applet.TextIconApplet {

this.mute_out_switch = new PopupMenu.PopupSwitchIconMenuItem(_("Mute output"), false, "audio-volume-muted-symbolic", St.IconType.SYMBOLIC);
this.mute_in_switch = new PopupMenu.PopupSwitchIconMenuItem(_("Mute input"), false, "microphone-sensitivity-muted-symbolic", St.IconType.SYMBOLIC);
this._applet_context_menu.addMenuItem(this.mute_out_switch); //FIXME
this._applet_context_menu.addMenuItem(this.mute_out_switch);
this._applet_context_menu.addMenuItem(this.mute_in_switch);
if (!this.alwaysCanChangeMic)
this.mute_in_switch.actor.hide();
Expand Down Expand Up @@ -2310,10 +2310,12 @@ class Sound150Applet extends Applet.TextIconApplet {
else
this.setAppletTextIcon();

if (this.alwaysCanChangeMic)
this.mute_in_switch.actor.show();
if (this.alwaysCanChangeMic)
if (this.mute_in_switch)
this.mute_in_switch.actor.show();
else if (this._recordingAppsNum === 0)
this.mute_in_switch.actor.hide();
if (this.mute_in_switch)
this.mute_in_switch.actor.hide();

this._changeActivePlayer(this._activePlayer);
}
Expand Down Expand Up @@ -2569,7 +2571,7 @@ class Sound150Applet extends Applet.TextIconApplet {

let newStatus = !this._input.is_muted;
this._input.change_is_muted(newStatus);
this.mute_in_switch.setToggleState(newStatus);
if (this.mute_in_switch) this.mute_in_switch.setToggleState(newStatus);
this.showOSD = this.showMediaKeysOSD;
this._volumeChange(null);
}
Expand Down Expand Up @@ -3242,9 +3244,11 @@ class Sound150Applet extends Applet.TextIconApplet {

_mutedChanged(object, param_spec, property) {
if (property == "_output") {
this.mute_out_switch.setToggleState(this._output.is_muted);
if (this.mute_out_switch)
this.mute_out_switch.setToggleState(this._output.is_muted);
} else if (property == "_input") {
this.mute_in_switch.setToggleState(this._input.is_muted);
if (this.mute_in_switch)
this.mute_in_switch.setToggleState(this._input.is_muted);
this._volumeChange(null);
}
}
Expand All @@ -3255,7 +3259,8 @@ class Sound150Applet extends Applet.TextIconApplet {

_outputValuesChanged(actor, iconName, percentage) {
this.setIcon(iconName, "output");
this.mute_out_switch.setIconSymbolicName(iconName);
if (this.mute_out_switch)
this.mute_out_switch.setIconSymbolicName(iconName);
this.volume = percentage;
this.setAppletTooltip();

Expand Down Expand Up @@ -3311,7 +3316,7 @@ class Sound150Applet extends Applet.TextIconApplet {
}

_inputValuesChanged(actor, iconName, percentage) {
this.mute_in_switch.setIconSymbolicName(iconName);
if (this.mute_in_switch) this.mute_in_switch.setIconSymbolicName(iconName);
this.mic_level = percentage;
}

Expand Down Expand Up @@ -3438,7 +3443,7 @@ class Sound150Applet extends Applet.TextIconApplet {
this._streams.push({ id: id, type: "SourceOutput" });
if (this._recordingAppsNum++ === 0) {
this._inputSection.actor.show();
this.mute_in_switch.actor.show();
if (this.mute_in_switch) this.mute_in_switch.actor.show();
run_playerctld();
}
}
Expand Down Expand Up @@ -3466,7 +3471,7 @@ class Sound150Applet extends Applet.TextIconApplet {

if (this.alwaysCanChangeMic) {
this._inputSection.actor.show();
this.mute_in_switch.actor.show();
if (this.mute_in_switch) this.mute_in_switch.actor.show();
}
//~ kill_playerctld();
}
Expand Down
3 changes: 3 additions & 0 deletions sound150@claudiux/files/sound150@claudiux/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### v8.0.2~20250126
* Improved stability with Cinnamon 6.4: More tests on the existence of objects before acting on them.

### v8.0.1~20250125
* Increases stability with Cinnamon 6.4: Removes Lang.bind() calls.

Expand Down
2 changes: 1 addition & 1 deletion sound150@claudiux/files/sound150@claudiux/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"max-instances": "1",
"description": "Enhanced sound applet",
"hide-configuration": false,
"version": "8.0.1",
"version": "8.0.2",
"cinnamon-version": [
"2.8",
"3.0",
Expand Down

0 comments on commit 8717498

Please sign in to comment.