Skip to content

Commit

Permalink
transparent-panels@germanfr: update state when a new monitor is added…
Browse files Browse the repository at this point in the history
… or removed

transparent-panels@germanfr: update state when a new monitor is added or removed
  • Loading branch information
claudiux authored Dec 29, 2023
2 parents a4b0491 + eaee085 commit c77ed76
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const Panel = imports.ui.panel;
const Settings = imports.ui.settings;
const St = imports.gi.St;
const Util = imports.misc.util;
const SignalManager = imports.misc.signalManager;

let Filter, Policies;
if (typeof require !== 'undefined') {
Expand Down Expand Up @@ -57,7 +58,7 @@ function MyExtension(meta) {
MyExtension.prototype = {
_init: function (meta) {
this.meta = meta;
this._signals = null;
this._signals = new SignalManager.SignalManager(null);
this._panel_status = new Array(Main.panelManager.panelCount);
for(let i = 0; i < this._panel_status.length; i++)
this._panel_status[i] = false;
Expand All @@ -75,6 +76,8 @@ MyExtension.prototype = {
this.settings.bind("panel-bottom", "enable_position_bottom", this.on_settings_changed);
this.settings.bind("panel-left", "enable_position_left", this.on_settings_changed);

this._signals.connect(Main.layoutManager, 'monitors-changed', () => this.on_state_change(-1), this);

this._classname = this.theme_defined ? this.transparency_type : this.transparency_type + INTERNAL_PREFIX;

Gettext.bindtextdomain(meta.uuid, GLib.get_home_dir() + "/.local/share/locale");
Expand All @@ -94,6 +97,8 @@ MyExtension.prototype = {
this.policy.disable();
this.settings.finalize();
this.settings = null;
this._signals.disconnectAllSignals();
this._signals = null;

Main.getPanels().forEach(panel => this.make_transparent(panel, false));
},
Expand Down

0 comments on commit c77ed76

Please sign in to comment.