IPC: Fail safe when no activeWindow detected
This commit is contained in:
parent
f8ed4f48cf
commit
bb0f1e84ce
1 changed files with 6 additions and 3 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue