From bb0f1e84ce16d2aa1515450b376a5b67ba3b89d0 Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Thu, 4 Sep 2025 10:16:15 -0400 Subject: [PATCH] IPC: Fail safe when no activeWindow detected --- Modules/IPC/IPCManager.qml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Modules/IPC/IPCManager.qml b/Modules/IPC/IPCManager.qml index 61487b4..285b876 100644 --- a/Modules/IPC/IPCManager.qml +++ b/Modules/IPC/IPCManager.qml @@ -11,10 +11,13 @@ Item { // Using Wayland protocols to get focused window then determine which screen it's on. function getActiveScreen() { const activeWindow = ToplevelManager.activeToplevel - if (activeWindow.screens.length > 0) { - return activeWindow.screens[0] + if (activeWindow && activeWindow.screens.length > 0) { + var screen = activeWindow.screens[0] + return screen } - return null + + // Fall back to the primary screen + return Quickshell.screens[0] } IpcHandler {