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:
Jonas Dreßler 2020-06-08 09:32:23 +02:00
parent d4f8ea1c53
commit 039431a73f

View File

@ -118,42 +118,42 @@ var WindowPreviewLayout = GObject.registerClass({
} }
} }
addWindow(clone, metaWindow) { addWindow(actor, metaWindow) {
if (this._windows.has(clone)) if (this._windows.has(actor))
return; return;
const windowActor = metaWindow.get_compositor_private(); const windowActor = metaWindow.get_compositor_private();
this._windows.set(clone, { this._windows.set(actor, {
metaWindow, metaWindow,
windowActor, windowActor,
sizeChangedId: metaWindow.connect('size-changed', () => sizeChangedId: metaWindow.connect('size-changed', () =>
this._layoutChanged()), this._layoutChanged()),
positionChangedId: metaWindow.connect('position-changed', () => positionChangedId: metaWindow.connect('position-changed', () =>
this._layoutChanged()), this._layoutChanged()),
destroyId: windowActor.connect('destroy', () => windowActorDestroyId: windowActor.connect('destroy', () =>
clone.destroy()), actor.destroy()),
cloneDestroyId: clone.connect('destroy', () => destroyId: actor.connect('destroy', () =>
this.removeWindow(clone)), this.removeWindow(actor)),
}); });
this._container.add_child(clone); this._container.add_child(actor);
this._layoutChanged(); this._layoutChanged();
} }
removeWindow(clone) { removeWindow(actor) {
const windowInfo = this._windows.get(clone); const windowInfo = this._windows.get(actor);
if (!windowInfo) if (!windowInfo)
return; return;
windowInfo.metaWindow.disconnect(windowInfo.sizeChangedId); windowInfo.metaWindow.disconnect(windowInfo.sizeChangedId);
windowInfo.metaWindow.disconnect(windowInfo.positionChangedId); windowInfo.metaWindow.disconnect(windowInfo.positionChangedId);
windowInfo.windowActor.disconnect(windowInfo.destroyId); windowInfo.windowActor.disconnect(windowInfo.windowActorDestroyId);
clone.disconnect(windowInfo.cloneDestroyId); actor.disconnect(windowInfo.destroyId);
this._windows.delete(clone); this._windows.delete(actor);
this._container.remove_child(clone); this._container.remove_child(actor);
this._layoutChanged(); this._layoutChanged();
} }