Skip to content

Never show the main window on a daemon launch - #5303

Merged
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
fix/daemon-blank-window
Aug 20, 2026
Merged

Never show the main window on a daemon launch#5303
Gabriel Dufresne (GabrielDuf) merged 2 commits into
mainfrom
fix/daemon-blank-window

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request refactors how the main window is managed during daemon (background) launches and when showing dialogs at startup. The changes ensure that the main window is only shown when necessary, preventing unwanted window flashes and fixing issues where dialogs could not be displayed if the window was hidden. It also prevents saving invalid window geometry when the window hasn't been displayed yet.

Window visibility and dialog management:

  • The logic that auto-hides the main window on first open during daemon launches has been removed, so the window is only shown if needed, preventing unnecessary window flashes.
  • The main window is now only shown at startup if not in daemon mode, ensuring that daemon launches remain silent and do not display the main window.
  • Dialogs that require the main window as an owner (such as crash reports and startup dialogs) now temporarily show the main window if it is hidden, and re-hide it after the dialog closes. This is implemented with a new helper method ShowStartupDialogAsync for consistency.

Window geometry persistence:

  • The SaveGeometryNow method now checks if the window has been laid out (i.e., has valid width and height) before saving geometry, preventing saving a 0x0 window size when the window hasn't been shown (such as in daemon launches).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Prevents unconditional main-window display during daemon startup while supporting startup dialogs and safe geometry persistence.

Changes:

  • Skips showing the main window in daemon mode.
  • Temporarily displays hidden windows for startup dialogs.
  • Avoids saving geometry before layout.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
App.axaml.cs Updates startup visibility and crash-dialog handling.
AvaloniaBootstrapper.cs Adds consistent hidden-owner dialog handling.
MainWindow.axaml.cs Guards against invalid geometry persistence.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/UniGetUI.Avalonia/App.axaml.cs Outdated
@GabrielDuf
Gabriel Dufresne (GabrielDuf) merged commit a61374f into main Aug 20, 2026
8 of 9 checks passed
@GabrielDuf
Gabriel Dufresne (GabrielDuf) deleted the fix/daemon-blank-window branch August 20, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Main window appears blank/non-interactive on auto start/login

3 participants