From aab98a45903e08f1f97b6d09f26df3f171923ca0 Mon Sep 17 00:00:00 2001 From: jderose9 Date: Sat, 11 Feb 2017 08:16:41 -0500 Subject: [PATCH] Handle scale_factor change after extension load Fixes #57 --- panel.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/panel.js b/panel.js index 520de9ea..5aa7f7d8 100644 --- a/panel.js +++ b/panel.js @@ -70,6 +70,11 @@ const dtpPanel = new Lang.Class({ this._setPanelPosition(); })); + // this is to catch changes to the window scale factor + this._ScaleFactorListener = St.ThemeContext.get_for_stage(global.stage).connect("changed", Lang.bind(this, function () { + this._setPanelPosition(); + })); + // The main panel's connection to the "allocate" signal is competing with this extension // trying to move the centerBox over to the right, creating a never-ending cycle. // Since we don't have the ID to disconnect that handler, wrap the allocate() function @@ -183,6 +188,9 @@ const dtpPanel = new Lang.Class({ if(this._MonitorsChangedListener !== null) { global.screen.disconnect(this._MonitorsChangedListener); } + if(this._ScaleFactorListener !== null) { + St.ThemeContext.get_for_stage(global.stage).disconnect(this._ScaleFactorListener); + } this.panel.actor.set_height(this._oldPanelHeight); this.panelBox.set_anchor_point(0, 0); Main.overview._overview.remove_child(this._myPanelGhost);