From 9a5a4b2206c0914208d2708d54a504c5414582fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 20 Jul 2018 17:27:33 +0200 Subject: [PATCH] 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 c29bd46e7a7e37a83849df8b3186c84eb46679ac. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/162 --- js/ui/workspaceThumbnail.js | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js index cf21e1317..76a7416c3 100644 --- a/js/ui/workspaceThumbnail.js +++ b/js/ui/workspaceThumbnail.js @@ -678,7 +678,11 @@ var ThumbnailsBox = new Lang.Class({ this._settings.connect('changed::dynamic-workspaces', 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._nWorkspacesNotifyId = 0; @@ -881,10 +885,6 @@ var ThumbnailsBox = new Lang.Class({ Main.overview.connect('windows-restacked', this._syncStacking.bind(this)); - this._workareasChangedId = - global.display.connect('workareas-changed', - this._rebuildThumbnails.bind(this)); - this._targetScale = 0; this._scale = 0; this._pendingScaleUpdate = false; @@ -918,24 +918,12 @@ var ThumbnailsBox = new Lang.Class({ this._syncStackingId = 0; } - if (this._workareasChangedId > 0) { - global.display.disconnect(this._workareasChangedId); - this._workareasChangedId = 0; - } - for (let w = 0; w < this._thumbnails.length; w++) this._thumbnails[w].destroy(); this._thumbnails = []; this._porthole = null; }, - _rebuildThumbnails() { - this._destroyThumbnails(); - - if (Main.overview.visible) - this._createThumbnails(); - }, - _workspacesChanged() { let validThumbnails = this._thumbnails.filter(t => t.state <= ThumbnailState.NORMAL);