Revert "workspaceThumbnail: rebuild thumbnails if workareas size changed"

It is unclear what the change was supposed to be fixing, but it
broke animations of workspace additions and removals, as those
events trigger the ::workareas-changed signal.

This reverts commit c29bd46e7a.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/162
This commit is contained in:
Florian Müllner 2018-07-20 17:27:33 +02:00 committed by Jonas Ådahl
parent 3ab9e9e8ad
commit 9a5a4b2206

View File

@ -678,7 +678,11 @@ 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', this._rebuildThumbnails.bind(this)); Main.layoutManager.connect('monitors-changed', () => {
this._destroyThumbnails();
if (Main.overview.visible)
this._createThumbnails();
});
this._switchWorkspaceNotifyId = 0; this._switchWorkspaceNotifyId = 0;
this._nWorkspacesNotifyId = 0; this._nWorkspacesNotifyId = 0;
@ -881,10 +885,6 @@ 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.display.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;
@ -918,24 +918,12 @@ var ThumbnailsBox = new Lang.Class({
this._syncStackingId = 0; this._syncStackingId = 0;
} }
if (this._workareasChangedId > 0) {
global.display.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);