workspace: Don't use clones' delegate to check children

The WindowClones are now themselves actors, so we can just check for
their type instead of checking for the delegate.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/700
This commit is contained in:
Marco Trevisan (Treviño) 2019-07-12 14:00:55 +02:00 committed by Florian Müllner
parent 031913b9df
commit 24d3744cb9

View File

@ -83,8 +83,8 @@ class WindowCloneLayout extends Clutter.LayoutManager {
vfunc_allocate(container, box, flags) { vfunc_allocate(container, box, flags) {
container.get_children().forEach(child => { container.get_children().forEach(child => {
let realWindow; let realWindow;
if (child == container._delegate._windowClone) if (child == container._windowClone)
realWindow = container._delegate.realWindow; realWindow = container.realWindow;
else else
realWindow = child.source; realWindow = child.source;
@ -1099,10 +1099,8 @@ const WorkspaceActor = GObject.registerClass(
class WorkspaceActor extends St.Widget { class WorkspaceActor extends St.Widget {
vfunc_get_focus_chain() { vfunc_get_focus_chain() {
return this.get_children().filter(c => c.visible).sort((a, b) => { return this.get_children().filter(c => c.visible).sort((a, b) => {
let cloneA = (a._delegate && a._delegate instanceof WindowClone) ? a._delegate : null; if (a instanceof WindowClone && b instanceof WindowClone)
let cloneB = (b._delegate && b._delegate instanceof WindowClone) ? b._delegate : null; return a.slotId - b.slotId;
if (cloneA && cloneB)
return cloneA.slotId - cloneB.slotId;
return 0; return 0;
}); });