cleanup: Replace deprecated lower/raise calls

Those methods have been deprecated for a long time, so
move to the drop-in replacement.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/808
This commit is contained in:
Florian Müllner 2019-11-05 20:17:19 +01:00
parent 0617be9fb9
commit 1e203f4631
16 changed files with 39 additions and 32 deletions

View File

@ -767,7 +767,7 @@ var BackgroundManager = class BackgroundManager {
if (this._controlPosition) {
let monitor = this._layoutManager.monitors[this._monitorIndex];
backgroundActor.set_position(monitor.x, monitor.y);
backgroundActor.lower_bottom();
this._container.set_child_below_sibling(backgroundActor, null);
}
let changeSignalId = background.connect('bg-changed', () => {

View File

@ -44,7 +44,7 @@ var BoxPointer = GObject.registerClass({
this._border = new St.DrawingArea();
this._border.connect('repaint', this._drawBorder.bind(this));
this.add_actor(this._border);
this.bin.raise(this._border);
this.set_child_above_sibling(this.bin, this._border);
this._sourceAlignment = 0.5;
this._muteInput = true;

View File

@ -338,7 +338,7 @@ var _Draggable = class _Draggable {
if (this.actor._delegate && this.actor._delegate.getDragActor) {
this._dragActor = this.actor._delegate.getDragActor();
Main.uiGroup.add_child(this._dragActor);
this._dragActor.raise_top();
Main.uiGroup.set_child_above_sibling(this._dragActor, null);
Shell.util_set_hidden_from_pick(this._dragActor, true);
// Drag actor does not always have to be the same as actor. For example drag actor
@ -388,7 +388,7 @@ var _Draggable = class _Draggable {
this._dragOrigParent.remove_actor(this._dragActor);
Main.uiGroup.add_child(this._dragActor);
this._dragActor.raise_top();
Main.uiGroup.set_child_above_sibling(this._dragActor, null);
Shell.util_set_hidden_from_pick(this._dragActor, true);
}

View File

@ -308,7 +308,7 @@ class IbusCandidatePopup extends BoxPointer.BoxPointer {
if (isVisible) {
this.setPosition(this._dummyCursor, 0);
this.open(BoxPointer.PopupAnimation.NONE);
this.raise_top();
this.get_parent().set_child_above_sibling(this, null);
} else {
this.close(BoxPointer.PopupAnimation.NONE);
}

View File

@ -269,7 +269,7 @@ var LayoutManager = GObject.registerClass({
this._backgroundGroup = new Meta.BackgroundGroup();
global.window_group.add_child(this._backgroundGroup);
this._backgroundGroup.lower_bottom();
global.window_group.set_child_below_sibling(this._backgroundGroup, null);
this._bgManagers = [];
this._interfaceSettings = new Gio.Settings({

View File

@ -139,7 +139,7 @@ var Lightbox = GObject.registerClass({
this.set({ opacity: 0, style_class: 'lightbox' });
container.add_actor(this);
this.raise_top();
container.set_child_above_sibling(this, null);
this.connect('destroy', this._onDestroy.bind(this));
@ -264,9 +264,9 @@ var Lightbox = GObject.registerClass({
let below = this;
for (let i = this._children.length - 1; i >= 0; i--) {
if (this._children[i] == window)
this._children[i].raise_top();
this._container.set_child_above_sibling(this._children[i], null);
else if (this._children[i] == this._highlighted)
this._children[i].lower(below);
this._container.set_child_below_sibling(this._children[i], below);
else
below = this._children[i];
}

View File

@ -1651,7 +1651,7 @@ class Crosshairs extends Clutter.Actor {
}
container.add_actor(crosshairsActor);
container.raise_child(magnifiedMouse, crosshairsActor);
container.set_child_above_sibling(magnifiedMouse, crosshairsActor);
let [xMouse, yMouse] = magnifiedMouse.get_position();
let [crosshairsWidth, crosshairsHeight] = crosshairsActor.get_size();
crosshairsActor.set_position(xMouse - crosshairsWidth / 2, yMouse - crosshairsHeight / 2);

View File

@ -206,7 +206,7 @@ var ModalDialog = GObject.registerClass({
this._hasModal = false;
if (!this._shellReactive)
this._eventBlocker.raise_top();
this.backgroundStack.set_child_above_sibling(this._eventBlocker, null);
}
pushModal(timestamp) {
@ -229,7 +229,7 @@ var ModalDialog = GObject.registerClass({
}
if (!this._shellReactive)
this._eventBlocker.lower_bottom();
this.backgroundStack.set_child_below_sibling(this._eventBlocker, null);
return true;
}

View File

@ -581,7 +581,8 @@ var Overview = class {
});
this._shadeBackgrounds();
this._coverPane.raise_top();
Main.layoutManager.overviewGroup.set_child_above_sibling(
this._coverPane, null);
this._coverPane.show();
this.emit('showing');
}
@ -644,7 +645,8 @@ var Overview = class {
});
this._unshadeBackgrounds();
this._coverPane.raise_top();
Main.layoutManager.overviewGroup.set_child_above_sibling(
this._coverPane, null);
this._coverPane.show();
this.emit('hiding');
}

View File

@ -892,7 +892,7 @@ var PopupMenu = class extends PopupMenuBase {
this._boxPointer.setPosition(this.sourceActor, this._arrowAlignment);
this._boxPointer.open(animate);
this.actor.raise_top();
this.actor.get_parent().set_child_above_sibling(this.actor, null);
this.emit('open-state-changed', true);
}

View File

@ -464,7 +464,7 @@ var ScreenShield = class {
this._backgroundGroup = new Clutter.Actor();
this._lockScreenGroup.add_actor(this._backgroundGroup);
this._backgroundGroup.lower_bottom();
this._lockScreenGroup.set_child_below_sibling(this._backgroundGroup, null);
this._bgManagers = [];
this._updateBackgrounds();

View File

@ -1874,13 +1874,13 @@ var WindowManager = class {
actor: new Clutter.Actor() };
switchData.surroundings[dir] = info;
switchData.container.add_actor(info.actor);
info.actor.raise_top();
switchData.container.set_child_above_sibling(info.actor, null);
let [x, y] = this._getPositionForDirection(dir, curWs, ws);
info.actor.set_position(x, y);
}
switchData.movingWindowBin.raise_top();
wgroup.set_child_above_sibling(switchData.movingWindowBin, null);
for (let i = 0; i < windows.length; i++) {
let actor = windows[i];

View File

@ -328,11 +328,12 @@ var WindowClone = GObject.registerClass({
// We'll fix up the stack after the drag
return;
let parent = this.get_parent();
let actualAbove = this.getActualStackAbove();
if (actualAbove == null)
this.lower_bottom();
parent.set_child_below_sibling(this, null);
else
this.raise(actualAbove);
parent.set_child_above_sibling(this, actualAbove);
}
_disconnectSignals() {
@ -462,11 +463,12 @@ var WindowClone = GObject.registerClass({
// We may not have a parent if DnD completed successfully, in
// which case our clone will shortly be destroyed and replaced
// with a new one on the target workspace.
if (this.get_parent() != null) {
let parent = this.get_parent();
if (parent !== null) {
if (this._stackAbove == null)
this.lower_bottom();
parent.set_child_below_sibling(this, null);
else
this.raise(this._stackAbove);
parent.set_child_above_sibling(this, this._stackAbove);
}
@ -671,7 +673,8 @@ var WindowOverlay = class {
}
_animateVisible() {
this._parentActor.raise_top();
this._parentActor.get_parent().set_child_above_sibling(
this._parentActor, null);
let toAnimate = [this.border, this.title];
if (this._windowCanClose())

View File

@ -124,11 +124,12 @@ var WindowClone = GObject.registerClass({
if (actor.inDrag)
return;
let parent = this.get_parent();
let actualAbove = this.getActualStackAbove();
if (actualAbove == null)
this.lower_bottom();
parent.set_child_below_sibling(this, null);
else
this.raise(actualAbove);
parent.set_child_above_sibling(this, actualAbove);
}
addAttachedDialog(win) {
@ -214,11 +215,12 @@ var WindowClone = GObject.registerClass({
// We may not have a parent if DnD completed successfully, in
// which case our clone will shortly be destroyed and replaced
// with a new one on the target workspace.
if (this.get_parent() != null) {
let parent = this.get_parent();
if (parent !== null) {
if (this._stackAbove == null)
this.lower_bottom();
parent.set_child_below_sibling(this, null);
else
this.raise(this._stackAbove);
parent.set_child_above_sibling(this, this._stackAbove);
}
@ -1014,7 +1016,7 @@ var ThumbnailsBox = GObject.registerClass({
this._queueUpdateStates();
// The thumbnails indicator actually needs to be on top of the thumbnails
this._indicator.raise_top();
this.set_child_above_sibling(this._indicator, null);
// Clear the splice index, we got the message
this._spliceIndex = -1;

View File

@ -80,7 +80,7 @@ var XdndHandler = class {
// Make sure that the cursor window is on top
if (this._cursorWindowClone)
this._cursorWindowClone.raise_top();
Main.uiGroup.set_child_above_sibling(this._cursorWindowClone, null);
let dragEvent = {
x: x,

View File

@ -154,7 +154,7 @@ class SizingIllustrator extends St.Widget {
add(child) {
this.child = child;
this.add_child(child);
this.child.lower_bottom();
this.set_child_below_sibling(child, null);
}
vfunc_get_preferred_width(forHeight) {