[gnome-shell/gbsneto/looking-glass-window-created] lookingGlass: Only update window list when visible
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/looking-glass-window-created] lookingGlass: Only update window list when visible
- Date: Thu, 12 Sep 2019 19:11:25 +0000 (UTC)
commit f7b5fa0e569a381e7ff63e7f17b79249189acaab
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Sep 12 15:45:04 2019 -0300
lookingGlass: Only update window list when visible
Updating the window list in the Looking Glass is a costly
operation: it destroys a whole lot of actors, and recreates
them. This triggers CSS changes, repaints, and allocations.
It is specially bad when paired with Wayland's big number
of window creations and deletions when showing Builder's
and Epiphany's popup window.
Only update the window list in the Looking Glass when it is
visible.
Related: https://gitlab.gnome.org/GNOME/mutter/issues/556
js/ui/lookingGlass.js | 13 +++++++++++++
1 file changed, 13 insertions(+)
---
diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js
index a53fd90db7..a4642c3f2f 100644
--- a/js/ui/lookingGlass.js
+++ b/js/ui/lookingGlass.js
@@ -306,6 +306,9 @@ var WindowList = class WindowList {
}
_updateWindowList() {
+ if (!this._lookingGlass.isOpen)
+ return;
+
this.actor.destroy_all_children();
let windows = global.get_window_actors();
let tracker = Shell.WindowTracker.get_default();
@@ -337,6 +340,10 @@ var WindowList = class WindowList {
}
}
}
+
+ update() {
+ this._updateWindowList();
+ }
};
Signals.addSignalMethods(WindowList.prototype);
@@ -1097,6 +1104,8 @@ var LookingGlass = class LookingGlass {
duration,
mode: Clutter.AnimationMode.EASE_OUT_QUAD
});
+
+ this._windowList.update();
}
close() {
@@ -1122,5 +1131,9 @@ var LookingGlass = class LookingGlass {
onComplete: () => this.actor.hide()
});
}
+
+ get isOpen() {
+ return this._open;
+ }
};
Signals.addSignalMethods(LookingGlass.prototype);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]