Show the lock screen dashboard on the largest output

The password and dashboard followed the focused monitor at lock time. Put
them on the largest output instead; the focused one only breaks ties.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-10-15 18:35:17 +02:00
1 parent b96b0cb683
commit da0a61b50b
1 file changed
+12 -2
+12 -2
View File
@@ -58,6 +58,16 @@ Singleton {
}; };
} }
// The dashboard goes on the largest output; the focused one breaks ties.
function mainScreen() {
const active = ScreenService.active;
let best = active || null;
for (const screen of Quickshell.screens) {
if (!best || screen.width * screen.height > best.width * best.height)
best = screen;
}
return best ? best.name : "";
}
function lock() { function lock() {
if (locked || grab.running) if (locked || grab.running)
return; return;
@@ -65,7 +75,7 @@ Singleton {
ShellState.settingsOpen = false; ShellState.settingsOpen = false;
ShellState.controlCenterOpen = false; ShellState.controlCenterOpen = false;
ShellState.launcherOpen = false; ShellState.launcherOpen = false;
primary = ScreenService.active ? ScreenService.active.name : ""; primary = mainScreen();
status = ""; status = "";
if (options.backdrop === "screenshot") { if (options.backdrop === "screenshot") {
grab.names = Quickshell.screens.map(s => s.name).filter(n => /^[\w.-]+$/.test(n)); grab.names = Quickshell.screens.map(s => s.name).filter(n => /^[\w.-]+$/.test(n));
@@ -78,7 +88,7 @@ Singleton {
if (locked) if (locked)
return; return;
ShellState.settingsOpen = false; ShellState.settingsOpen = false;
primary = ScreenService.active ? ScreenService.active.name : ""; primary = mainScreen();
status = ""; status = "";
previewing = true; previewing = true;
} }