js: Stop using ClutterContainer API

These have been long deprecated over in clutter, and (via several
vtables) simply forward the call to the equivalent ClutterActor methods

Save ourselves the hassle and just use ClutterActor methods directly

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3010>
This commit is contained in:
Zander Brown
2023-11-07 10:47:14 +00:00
committed by Marge Bot
parent ed3b8d093e
commit 350cd296fa
54 changed files with 263 additions and 263 deletions

View File

@ -109,7 +109,7 @@ export class Magnifier extends Signals.EventEmitter {
this._mouseSprite.content = new MouseSpriteContent();
this._cursorRoot = new Clutter.Actor();
this._cursorRoot.add_actor(this._mouseSprite);
this._cursorRoot.add_child(this._mouseSprite);
// Create the first ZoomRegion and initialize it according to the
// magnification settings.
@ -1471,7 +1471,7 @@ class ZoomRegion {
_createActors() {
// The root actor for the zoom region
this._magView = new St.Bin({style_class: 'magnifier-zoom-region'});
global.stage.add_actor(this._magView);
global.stage.add_child(this._magView);
// hide the magnified region from CLUTTER_PICK_ALL
Shell.util_set_hidden_from_pick(this._magView, true);
@ -1483,7 +1483,7 @@ class ZoomRegion {
// Add a background for when the magnified uiGroup is scrolled
// out of view (don't want to see desktop showing through).
this._background = new Background.SystemBackground();
mainGroup.add_actor(this._background);
mainGroup.add_child(this._background);
// Clone the group that contains all of UI on the screen. This is the
// chrome, the windows, etc.
@ -1491,7 +1491,7 @@ class ZoomRegion {
source: Main.uiGroup,
clip_to_allocation: true,
});
mainGroup.add_actor(this._uiGroupClone);
mainGroup.add_child(this._uiGroupClone);
// Add either the given mouseSourceActor to the ZoomRegion, or a clone of
// it.
@ -1499,7 +1499,7 @@ class ZoomRegion {
this._mouseActor = new Clutter.Clone({source: this._mouseSourceActor});
else
this._mouseActor = this._mouseSourceActor;
mainGroup.add_actor(this._mouseActor);
mainGroup.add_child(this._mouseActor);
if (this._crossHairs)
this._crossHairsActor = this._crossHairs.addToZoomRegion(this, this._mouseActor);
@ -1516,7 +1516,7 @@ class ZoomRegion {
_destroyActors() {
if (this._mouseActor === this._mouseSourceActor)
this._mouseActor.get_parent().remove_actor(this._mouseActor);
this._mouseActor.get_parent().remove_child(this._mouseActor);
if (this._crossHairs)
this._crossHairs.removeFromParent(this._crossHairsActor);
@ -1833,10 +1833,10 @@ class Crosshairs extends Clutter.Actor {
this._horizRightHair = new Clutter.Actor();
this._vertTopHair = new Clutter.Actor();
this._vertBottomHair = new Clutter.Actor();
this.add_actor(this._horizLeftHair);
this.add_actor(this._horizRightHair);
this.add_actor(this._vertTopHair);
this.add_actor(this._vertBottomHair);
this.add_child(this._horizLeftHair);
this.add_child(this._horizRightHair);
this.add_child(this._vertTopHair);
this.add_child(this._vertBottomHair);
this._clipSize = [0, 0];
this._clones = [];
this.reCenter();
@ -1887,7 +1887,7 @@ class Crosshairs extends Clutter.Actor {
GObject.BindingFlags.SYNC_CREATE);
}
container.add_actor(crosshairsActor);
container.add_child(crosshairsActor);
container.set_child_above_sibling(magnifiedMouse, crosshairsActor);
let [xMouse, yMouse] = magnifiedMouse.get_position();
let [crosshairsWidth, crosshairsHeight] = crosshairsActor.get_size();
@ -1908,7 +1908,7 @@ class Crosshairs extends Clutter.Actor {
*/
removeFromParent(childActor) {
if (childActor === this)
childActor.get_parent().remove_actor(childActor);
childActor.get_parent().remove_child(childActor);
else
childActor.destroy();
}