workspaceThumbnail: don't queue unnecessary relayouts

Relayouts are expensive and can make the UI laggy.
This commit is contained in:
Stefano Facchini 2012-02-21 20:46:27 +01:00
parent 916c62a702
commit 786beccca5

View File

@ -598,6 +598,9 @@ const ThumbnailsBox = new Lang.Class({
}, },
_clearDragPlaceholder: function() { _clearDragPlaceholder: function() {
if (this._dropPlaceholderPos == -1)
return;
this._dropPlaceholderPos = -1; this._dropPlaceholderPos = -1;
this.actor.queue_relayout(); this.actor.queue_relayout();
}, },
@ -635,8 +638,10 @@ const ThumbnailsBox = new Lang.Class({
} }
} }
this._dropPlaceholderPos = workspace; if (this._dropPlaceholderPos != workspace) {
this.actor.queue_relayout(); this._dropPlaceholderPos = workspace;
this.actor.queue_relayout();
}
if (workspace == -1) if (workspace == -1)
return DND.DragMotionResult.CONTINUE; return DND.DragMotionResult.CONTINUE;