Handle scale_factor change after extension load

Fixes #57
This commit is contained in:
jderose9
2017-02-11 08:16:41 -05:00
parent 6c867fb97d
commit aab98a4590

View File

@@ -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);