workspace: Handle child not being present in the window slots array
Adding children to the WorkspaceLayout without calling addPreview() is not supported, so let's log an error in case that happened. We also have to allocate that child an empty ClutterActorBox, otherwise Clutter will complain loudly. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1481>
This commit is contained in:
parent
3fb0284358
commit
a314c05fec
@ -595,8 +595,11 @@ var WorkspaceLayout = GObject.registerClass({
|
||||
|
||||
// The fifth element in the slot array is the WindowPreview
|
||||
const index = this._windowSlots.findIndex(s => s[4] === child);
|
||||
if (index === -1)
|
||||
if (index === -1) {
|
||||
log('Couldn\'t find child %s in window slots'.format(child));
|
||||
child.allocate(childBox);
|
||||
continue;
|
||||
}
|
||||
|
||||
const [x, y, width, height] = this._windowSlots[index];
|
||||
const windowInfo = this._windows.get(child);
|
||||
|
Loading…
Reference in New Issue
Block a user