Skip to content

Commit

Permalink
Handle scale_factor change after extension load
Browse files Browse the repository at this point in the history
Fixes #57
  • Loading branch information
jderose9 committed Feb 11, 2017
1 parent 6c867fb commit aab98a4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit aab98a4

Please sign in to comment.