[gnome-shell] dnd: Hide drag actor from pick
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] dnd: Hide drag actor from pick
- Date: Thu, 18 Nov 2010 19:29:56 +0000 (UTC)
commit be6e189b4917c012585a7dffd056c8c06ae5c75a
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Nov 17 11:00:35 2010 +0100
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 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index 9ebb2d4..04e5401 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();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]