Workspace/WorkspaceThumbnail: fix Clutter warnings from stacking code

Windows can be restacked at any time, including when the stackAbove
property of the window clone is being dragged, and thus parented to
the uiGroup. To do stacking properly, we need to skip it for the duration
of the drag, and sync it again at the end (which is already done by
mutter because of the workspace change)

https://bugzilla.gnome.org/show_bug.cgi?id=685285
This commit is contained in:
Giovanni Campagna 2013-01-19 02:22:15 +01:00
parent d3ab367fcd
commit ceae032112
2 changed files with 45 additions and 4 deletions

View File

@ -121,15 +121,33 @@ const WindowClone = new Lang.Class({
return this._slot;
},
// Find the actor just below us, respecting reparenting done
// by DND code
getActualStackAbove: function() {
if (this._stackAbove == null)
return null;
if (this.inDrag || this._zooming) {
if (this._stackAbove._delegate)
return this._stackAbove._delegate.getActualStackAbove();
else
return null;
} else {
return this._stackAbove;
}
},
setStackAbove: function (actor) {
this._stackAbove = actor;
if (this.inDrag)
// We'll fix up the stack after the drag
return;
if (this._stackAbove == null)
let actualAbove = this.getActualStackAbove();
if (actualAbove == null)
this.actor.lower_bottom();
else
this.actor.raise(this._stackAbove);
this.actor.raise(actualAbove);
},
destroy: function () {

View File

@ -62,12 +62,35 @@ const WindowClone = new Lang.Class({
this.inDrag = false;
},
// Find the actor just below us, respecting reparenting done
// by DND code
getActualStackAbove: function() {
if (this._stackAbove == null)
return null;
if (this.inDrag) {
if (this._stackAbove._delegate)
return this._stackAbove._delegate.getActualStackAbove();
else
return null;
} else {
return this._stackAbove;
}
},
setStackAbove: function (actor) {
this._stackAbove = actor;
if (this._stackAbove == null)
// Don't apply the new stacking now, it will be applied
// when dragging ends and window are stacked again
if (actor.inDrag)
return;
let actualAbove = this.getActualStackAbove();
if (actualAbove == null)
this.actor.lower_bottom();
else
this.actor.raise(this._stackAbove);
this.actor.raise(actualAbove);
},
destroy: function () {