diff --git a/src/manager/event_manager.ts b/src/manager/event_manager.ts index b0be43bd..a24eb19c 100644 --- a/src/manager/event_manager.ts +++ b/src/manager/event_manager.ts @@ -150,25 +150,37 @@ function applyEffectTo(actor: RoundedWindowActor) { // that? I have no idea. But without that, weird bugs can happen. For // example, when using Dash to Dock, all opened windows will be invisible // *unless they are pinned in the dock*. So yeah, GNOME is magic. - connect(actor, 'notify::size', () => handlers.onSizeChanged(actor)); + connect(actor, 'notify::size', () => { + if (actor.metaWindow) { + handlers.onSizeChanged(actor); + } + }); connect(texture, 'size-changed', () => { - handlers.onSizeChanged(actor); + if (actor.metaWindow) { + handlers.onSizeChanged(actor); + } }); // Get notified about fullscreen explicitly, since a window must not change in // size to go fullscreen - connect(actor.metaWindow, 'notify::fullscreen', () => - handlers.onSizeChanged(actor), - ); + connect(actor.metaWindow, 'notify::fullscreen', () => { + if (actor.metaWindow) { + handlers.onSizeChanged(actor); + } + }); // Window focus changed. - connect(actor.metaWindow, 'notify::appears-focused', () => - handlers.onFocusChanged(actor), - ); + connect(actor.metaWindow, 'notify::appears-focused', () => { + if (actor.metaWindow) { + handlers.onFocusChanged(actor); + } + }); // Workspace or monitor of the window changed. connect(actor.metaWindow, 'workspace-changed', () => { - handlers.onFocusChanged(actor); + if (actor.metaWindow) { + handlers.onFocusChanged(actor); + } }); handlers.onAddEffect(actor);