[gnome-shell] workspaceThumbnail: don't queue unnecessary relayouts
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] workspaceThumbnail: don't queue unnecessary relayouts
- Date: Wed, 22 Feb 2012 12:37:11 +0000 (UTC)
commit 786beccca5d3f6252a1aa331453dddfd4c2486fb
Author: Stefano Facchini <stefano facchini gmail com>
Date: Tue Feb 21 20:46:27 2012 +0100
workspaceThumbnail: don't queue unnecessary relayouts
Relayouts are expensive and can make the UI laggy.
js/ui/workspaceThumbnail.js | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js
index 52b2a74..1d18e02 100644
--- a/js/ui/workspaceThumbnail.js
+++ b/js/ui/workspaceThumbnail.js
@@ -598,6 +598,9 @@ const ThumbnailsBox = new Lang.Class({
},
_clearDragPlaceholder: function() {
+ if (this._dropPlaceholderPos == -1)
+ return;
+
this._dropPlaceholderPos = -1;
this.actor.queue_relayout();
},
@@ -635,8 +638,10 @@ const ThumbnailsBox = new Lang.Class({
}
}
- this._dropPlaceholderPos = workspace;
- this.actor.queue_relayout();
+ if (this._dropPlaceholderPos != workspace) {
+ this._dropPlaceholderPos = workspace;
+ this.actor.queue_relayout();
+ }
if (workspace == -1)
return DND.DragMotionResult.CONTINUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]