dnd: Don't queue an idle handler if we already have one

Removing an existing source before scheduling a new one is not wrong,
but slightly less effective than doing nothing and relying on the
previously created source to do the job.

https://bugzilla.gnome.org/show_bug.cgi?id=711555
This commit is contained in:
Florian Müllner 2013-11-06 18:22:47 +01:00
parent 735f589b1c
commit fce2930b85

View File

@ -391,7 +391,7 @@ const _Draggable = new Lang.Class({
_queueUpdateDragHover: function() { _queueUpdateDragHover: function() {
if (this._updateHoverId) if (this._updateHoverId)
GLib.source_remove(this._updateHoverId); return;
this._updateHoverId = GLib.idle_add(GLib.PRIORITY_DEFAULT, this._updateHoverId = GLib.idle_add(GLib.PRIORITY_DEFAULT,
Lang.bind(this, this._updateDragHover)); Lang.bind(this, this._updateDragHover));