From be6e189b4917c012585a7dffd056c8c06ae5c75a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 17 Nov 2010 11:00:35 +0100 Subject: [PATCH] dnd: Hide drag actor from pick Instead of hiding the drag actor temporarily to determine the actor beneath it, make it invisible to picks while dragging using the new shell_util_set_hidden_from_pick(). https://bugzilla.gnome.org/show_bug.cgi?id=634560 --- js/ui/dnd.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/js/ui/dnd.js b/js/ui/dnd.js index 9ebb2d400..04e540194 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -267,6 +267,7 @@ _Draggable.prototype = { this._dragActor.reparent(this.actor.get_stage()); this._dragActor.raise_top(); + Shell.util_set_hidden_from_pick(this._dragActor, true); this._dragOrigOpacity = this._dragActor.opacity; if (this._dragActorOpacity != undefined) @@ -332,12 +333,8 @@ _Draggable.prototype = { this._dragActor.set_position(stageX + this._dragOffsetX, stageY + this._dragOffsetY); - // Because we want to find out what other actor is located at the current position of this._dragActor, - // we have to temporarily hide this._dragActor. - this._dragActor.hide(); let target = this._dragActor.get_stage().get_actor_at_pos(Clutter.PickMode.ALL, stageX, stageY); - this._dragActor.show(); // We call observers only once per motion with the innermost // target actor. If necessary, the observer can walk the @@ -384,13 +381,9 @@ _Draggable.prototype = { }, _dragActorDropped: function(event) { - // Find a drop target. Because we want to find out what other actor is located at - // the current position of this._dragActor, we have to temporarily hide this._dragActor. - this._dragActor.hide(); let [dropX, dropY] = event.get_coords(); let target = this._dragActor.get_stage().get_actor_at_pos(Clutter.PickMode.ALL, dropX, dropY); - this._dragActor.show(); // We call observers only once per motion with the innermost // target actor. If necessary, the observer can walk the @@ -522,6 +515,8 @@ _Draggable.prototype = { }, _dragComplete: function() { + Shell.util_set_hidden_from_pick(this._dragActor, false); + this._dragActor = undefined; currentDraggable = null; this._ungrabEvents();