workspaceThumbnail: rebuild thumbnails if workareas size changed
https://bugzilla.gnome.org/show_bug.cgi?id=792687
(cherry picked from commit c29bd46e7a
)
This commit is contained in:
parent
4b6a57fabe
commit
a27be6a540
@ -673,11 +673,7 @@ var ThumbnailsBox = new Lang.Class({
|
|||||||
this._settings.connect('changed::dynamic-workspaces',
|
this._settings.connect('changed::dynamic-workspaces',
|
||||||
this._updateSwitcherVisibility.bind(this));
|
this._updateSwitcherVisibility.bind(this));
|
||||||
|
|
||||||
Main.layoutManager.connect('monitors-changed', () => {
|
Main.layoutManager.connect('monitors-changed', this._rebuildThumbnails.bind(this));
|
||||||
this._destroyThumbnails();
|
|
||||||
if (Main.overview.visible)
|
|
||||||
this._createThumbnails();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateSwitcherVisibility() {
|
_updateSwitcherVisibility() {
|
||||||
@ -870,6 +866,9 @@ var ThumbnailsBox = new Lang.Class({
|
|||||||
Main.overview.connect('windows-restacked',
|
Main.overview.connect('windows-restacked',
|
||||||
this._syncStacking.bind(this));
|
this._syncStacking.bind(this));
|
||||||
|
|
||||||
|
this._workareasChangedId =
|
||||||
|
global.screen.connect('workareas-changed', this._rebuildThumbnails.bind(this));
|
||||||
|
|
||||||
this._targetScale = 0;
|
this._targetScale = 0;
|
||||||
this._scale = 0;
|
this._scale = 0;
|
||||||
this._pendingScaleUpdate = false;
|
this._pendingScaleUpdate = false;
|
||||||
@ -899,12 +898,24 @@ var ThumbnailsBox = new Lang.Class({
|
|||||||
this._syncStackingId = 0;
|
this._syncStackingId = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this._workareasChangedId > 0) {
|
||||||
|
global.screen.disconnect(this._workareasChangedId);
|
||||||
|
this._workareasChangedId = 0;
|
||||||
|
}
|
||||||
|
|
||||||
for (let w = 0; w < this._thumbnails.length; w++)
|
for (let w = 0; w < this._thumbnails.length; w++)
|
||||||
this._thumbnails[w].destroy();
|
this._thumbnails[w].destroy();
|
||||||
this._thumbnails = [];
|
this._thumbnails = [];
|
||||||
this._porthole = null;
|
this._porthole = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_rebuildThumbnails() {
|
||||||
|
this._destroyThumbnails();
|
||||||
|
|
||||||
|
if (Main.overview.visible)
|
||||||
|
this._createThumbnails();
|
||||||
|
},
|
||||||
|
|
||||||
_workspacesChanged() {
|
_workspacesChanged() {
|
||||||
let validThumbnails =
|
let validThumbnails =
|
||||||
this._thumbnails.filter(t => t.state <= ThumbnailState.NORMAL);
|
this._thumbnails.filter(t => t.state <= ThumbnailState.NORMAL);
|
||||||
|
Loading…
Reference in New Issue
Block a user