workspaceThumbnail: don't queue unnecessary relayouts
Relayouts are expensive and can make the UI laggy.
This commit is contained in:
parent
916c62a702
commit
786beccca5
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user