mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-07-19 08:13:10 -05:00
fix(desktop): show hidden window when relaunched from tray
When the app is hidden in the tray, closing then relaunching it triggered the single-instance second-instance handler, which only called focus() — a hidden window stays hidden on focus(), so the app appeared not to start (notably on KDE Plasma Wayland where the tray icon may also be unreachable). Call show() to surface it, and recreate the window if it no longer exists.
This commit is contained in:
+6
-1
@@ -100,10 +100,15 @@ app.on('second-instance', (_event, argv) => {
|
||||
return
|
||||
}
|
||||
|
||||
// Focus the main window
|
||||
// Reveal the main window. It may be hidden in the tray (not just minimized),
|
||||
// so show() is required — focus() alone won't surface a hidden window, which
|
||||
// made the app look dead when relaunched while running in the tray.
|
||||
if (mainWindow) {
|
||||
if (mainWindow.isMinimized()) mainWindow.restore()
|
||||
mainWindow.show()
|
||||
mainWindow.focus()
|
||||
} else if (serverPort) {
|
||||
createMainWindow()
|
||||
}
|
||||
|
||||
// Find the deep link URL in argv
|
||||
|
||||
Reference in New Issue
Block a user