Skip to content

Bring existing window to foreground on second launch instead of error#781

Merged
erikdarlingdata merged 1 commit intodevfrom
fix/769-bring-to-foreground
Apr 2, 2026
Merged

Bring existing window to foreground on second launch instead of error#781
erikdarlingdata merged 1 commit intodevfrom
fix/769-bring-to-foreground

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • Lite: Replace "already running" error dialog with FindWindow/SetForegroundWindow to activate the existing instance. Uses IsIconic check to only call SW_RESTORE when minimized, preserving maximized state.
  • Dashboard: Fix WndProc handler to only reset WindowState when minimized, preserving maximized state on second-launch activation.
  • Minimize-to-tray setting preserved as a user option in both apps.

Fixes #769

Test plan

  • Lite: Launch maximized, double-click exe again — brings to foreground, stays maximized
  • Lite: Launch minimized, double-click exe again — restores window
  • Dashboard: Launch maximized, double-click exe again — brings to foreground, stays maximized
  • Minimize-to-tray setting still works when enabled

🤖 Generated with Claude Code

Lite: Replace "already running" error dialog with FindWindow/
SetForegroundWindow to activate the existing instance. Only call
SW_RESTORE if the window is minimized (IsIconic) to preserve
maximized state.

Dashboard: Fix WndProc handler to only reset WindowState when
minimized, preserving maximized state on second-launch activation.

Both: Keep minimize-to-tray as a user setting — when enabled, the
window hides from the taskbar on minimize (restored via tray icon).

Fixes #769

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 3efa63b into dev Apr 2, 2026
3 checks passed
@erikdarlingdata erikdarlingdata deleted the fix/769-bring-to-foreground branch April 9, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant