summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2009-10-03 00:17:34 (GMT)
committerColin Walters <walters@verbum.org>2009-10-05 15:32:33 (GMT)
commit2f6c95199770e5bb751a1a1f72cdb745faf5555b (patch)
treeb096321fe253406122e4c05e1511fb951593e03b
parent64cd51667dc498412cbaeb53cd92cc6de7a04e23 (diff)
downloadgnome-shell-2f6c95199770e5bb751a1a1f72cdb745faf5555b.tar.gz
gnome-shell-2f6c95199770e5bb751a1a1f72cdb745faf5555b.tar.xz
Avoid doing expensive work when not mapped
For some unknown reason we were connecting to app-added and app-removed on ShellAppMonitor in the AppDisplay class, which never made any use of the data. Simply don't connect to those signals for now. In the future we should have AppDisplay be using the AppIcon class which will more correctly handle dynamic changes. In the AppWell, avoid doing the full relayout until we're actually mapped. https://bugzilla.gnome.org/show_bug.cgi?id=597169
-rw-r--r--js/ui/appDisplay.js24
1 files changed, 16 insertions, 8 deletions
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index bcdfcff..7f2b812 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -192,14 +192,6 @@ AppDisplay.prototype = {
this._appsStale = true;
this._redisplay(GenericDisplay.RedisplayFlags.NONE);
}));
- this._appMonitor.connect('app-added', Lang.bind(this, function(monitor) {
- this._appsStale = true;
- this._redisplay(GenericDisplay.RedisplayFlags.NONE);
- }));
- this._appMonitor.connect('app-removed', Lang.bind(this, function(monitor) {
- this._appsStale = true;
- this._redisplay(GenericDisplay.RedisplayFlags.NONE);
- }));
this._focusInMenus = true;
this._activeMenuIndex = -1;
@@ -770,6 +762,9 @@ AppWell.prototype = {
x_align: Big.BoxAlignment.CENTER });
this.actor._delegate = this;
+ this._pendingRedisplay = false;
+ this.actor.connect('notify::mapped', Lang.bind(this, this._onMappedNotify));
+
this._grid = new WellGrid();
this.actor.append(this._grid.actor, Big.BoxPackFlags.EXPAND);
@@ -809,7 +804,20 @@ AppWell.prototype = {
values[id] = index; return values; }, {});
},
+ _onMappedNotify: function() {
+ let mapped = this.actor.mapped;
+ if (mapped && this._pendingRedisplay)
+ this._redisplay();
+ },
+
_redisplay: function () {
+ let mapped = this.actor.mapped;
+ if (!mapped) {
+ this._pendingRedisplay = true;
+ return;
+ }
+ this._pendingRedisplay = false;
+
this._grid.removeAll();
let favoriteIds = this._appSystem.get_favorites();