[gnome-shell] dnd: Don't use reparent for adding actors to the uiGroup
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] dnd: Don't use reparent for adding actors to the uiGroup
- Date: Wed, 30 Oct 2013 17:21:02 +0000 (UTC)
commit 9d2791d9f8f6d0bb62998ca94f4372b9d0438b5d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Aug 26 19:14:35 2013 -0400
dnd: Don't use reparent for adding actors to the uiGroup
It's deprecated, terrible, and causes get_theme_node crashes.
js/ui/dnd.js | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index c0d09ce..54193ad 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -236,7 +236,7 @@ const _Draggable = new Lang.Class({
if (this.actor._delegate && this.actor._delegate.getDragActor) {
this._dragActor = this.actor._delegate.getDragActor();
- this._dragActor.reparent(Main.uiGroup);
+ Main.uiGroup.add_child(this._dragActor);
this._dragActor.raise_top();
Shell.util_set_hidden_from_pick(this._dragActor, true);
@@ -285,7 +285,8 @@ const _Draggable = new Lang.Class({
this._dragOffsetX = actorStageX - this._dragStartX;
this._dragOffsetY = actorStageY - this._dragStartY;
- this._dragActor.reparent(Main.uiGroup);
+ this._dragOrigParent.remove_actor(this._dragActor);
+ Main.uiGroup.add_child(this._dragActor);
this._dragActor.raise_top();
Shell.util_set_hidden_from_pick(this._dragActor, true);
}
@@ -555,7 +556,8 @@ const _Draggable = new Lang.Class({
_onAnimationComplete : function (dragActor, eventTime) {
if (this._dragOrigParent) {
- dragActor.reparent(this._dragOrigParent);
+ Main.uiGroup.remove_child(this._dragActor);
+ this._dragOrigParent.add_actor(this._dragActor);
dragActor.set_scale(this._dragOrigScale, this._dragOrigScale);
dragActor.set_position(this._dragOrigX, this._dragOrigY);
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]