workspace: Stop using clone terminology in WindowPreviewLayout
We're going to remove ClutterClones, so call the parameters to addWindow() and removeWindow() "actor" instead of "clone". Also make the destroyIds less confusing and rename the actual actor destroy id to "destroyId", and rename the window actors destroy id to "windowActorDestroyId". https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1307
This commit is contained in:
parent
d4f8ea1c53
commit
039431a73f
@ -118,42 +118,42 @@ var WindowPreviewLayout = GObject.registerClass({
|
||||
}
|
||||
}
|
||||
|
||||
addWindow(clone, metaWindow) {
|
||||
if (this._windows.has(clone))
|
||||
addWindow(actor, metaWindow) {
|
||||
if (this._windows.has(actor))
|
||||
return;
|
||||
|
||||
const windowActor = metaWindow.get_compositor_private();
|
||||
|
||||
this._windows.set(clone, {
|
||||
this._windows.set(actor, {
|
||||
metaWindow,
|
||||
windowActor,
|
||||
sizeChangedId: metaWindow.connect('size-changed', () =>
|
||||
this._layoutChanged()),
|
||||
positionChangedId: metaWindow.connect('position-changed', () =>
|
||||
this._layoutChanged()),
|
||||
destroyId: windowActor.connect('destroy', () =>
|
||||
clone.destroy()),
|
||||
cloneDestroyId: clone.connect('destroy', () =>
|
||||
this.removeWindow(clone)),
|
||||
windowActorDestroyId: windowActor.connect('destroy', () =>
|
||||
actor.destroy()),
|
||||
destroyId: actor.connect('destroy', () =>
|
||||
this.removeWindow(actor)),
|
||||
});
|
||||
|
||||
this._container.add_child(clone);
|
||||
this._container.add_child(actor);
|
||||
|
||||
this._layoutChanged();
|
||||
}
|
||||
|
||||
removeWindow(clone) {
|
||||
const windowInfo = this._windows.get(clone);
|
||||
removeWindow(actor) {
|
||||
const windowInfo = this._windows.get(actor);
|
||||
if (!windowInfo)
|
||||
return;
|
||||
|
||||
windowInfo.metaWindow.disconnect(windowInfo.sizeChangedId);
|
||||
windowInfo.metaWindow.disconnect(windowInfo.positionChangedId);
|
||||
windowInfo.windowActor.disconnect(windowInfo.destroyId);
|
||||
clone.disconnect(windowInfo.cloneDestroyId);
|
||||
windowInfo.windowActor.disconnect(windowInfo.windowActorDestroyId);
|
||||
actor.disconnect(windowInfo.destroyId);
|
||||
|
||||
this._windows.delete(clone);
|
||||
this._container.remove_child(clone);
|
||||
this._windows.delete(actor);
|
||||
this._container.remove_child(actor);
|
||||
|
||||
this._layoutChanged();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user