Replace an already-open settings window instead of ignoring the request

When the settings window was open but buried under other windows, asking
for it again from the tray did nothing, so it could not be reached. Asking
the existing window to rise only makes the taskbar entry blink under KWin
(focus-stealing prevention), so the daemon now closes it and opens a fresh
one, which always appears on top. Settings are saved as they change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-30 09:12:17 +01:00
parent fee42ae92d
commit 23f72eff3d
2 changed files with 7 additions and 4 deletions
+6 -4
View File
@@ -181,10 +181,12 @@ impl Core {
}
fn open_settings(&mut self) {
if let Some(c) = &mut self.settings {
if matches!(c.try_wait(), Ok(None)) {
return; // already open
}
// A window that is still open may be buried under others, and KWin's focus-stealing prevention
// only makes the taskbar entry blink when another process asks it to rise: replace it with a
// fresh one, which always appears on top. The settings are saved as they change.
if let Some(mut c) = self.settings.take() {
let _ = c.kill();
let _ = c.wait();
}
let sibling = std::env::current_exe().ok().map(|p| p.with_file_name("sourizz-settings")).filter(|p| p.is_file());
let program = sibling.unwrap_or_else(|| "sourizz-settings".into());