This commit is contained in:
Ly-sec 2025-09-04 16:19:02 +02:00
commit ac7092943c
3 changed files with 15 additions and 4 deletions

View file

@ -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 {