[gnome-shell/gnome-3-28] workspaceThumbnail: rebuild thumbnails if workareas size changed
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-28] workspaceThumbnail: rebuild thumbnails if workareas size changed
- Date: Wed, 18 Apr 2018 00:35:14 +0000 (UTC)
commit a27be6a540e87641a56241b379af2f05ecab7763
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Fri Jan 19 16:39:13 2018 +0100
workspaceThumbnail: rebuild thumbnails if workareas size changed
https://bugzilla.gnome.org/show_bug.cgi?id=792687
(cherry picked from commit c29bd46e7a7e37a83849df8b3186c84eb46679ac)
js/ui/workspaceThumbnail.js | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js
index a1b0d9236..78fac80dd 100644
--- a/js/ui/workspaceThumbnail.js
+++ b/js/ui/workspaceThumbnail.js
@@ -673,11 +673,7 @@ var ThumbnailsBox = new Lang.Class({
this._settings.connect('changed::dynamic-workspaces',
this._updateSwitcherVisibility.bind(this));
- Main.layoutManager.connect('monitors-changed', () => {
- this._destroyThumbnails();
- if (Main.overview.visible)
- this._createThumbnails();
- });
+ Main.layoutManager.connect('monitors-changed', this._rebuildThumbnails.bind(this));
},
_updateSwitcherVisibility() {
@@ -870,6 +866,9 @@ var ThumbnailsBox = new Lang.Class({
Main.overview.connect('windows-restacked',
this._syncStacking.bind(this));
+ this._workareasChangedId =
+ global.screen.connect('workareas-changed', this._rebuildThumbnails.bind(this));
+
this._targetScale = 0;
this._scale = 0;
this._pendingScaleUpdate = false;
@@ -899,12 +898,24 @@ var ThumbnailsBox = new Lang.Class({
this._syncStackingId = 0;
}
+ if (this._workareasChangedId > 0) {
+ global.screen.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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]