Skip to content

fix(build): honor [tool.flet.app].hide_window_on_start in Windows runner#6562

Merged
FeodorFitsner merged 2 commits into
mainfrom
fix/hide-window-on-start-windows-runner
Jun 8, 2026
Merged

fix(build): honor [tool.flet.app].hide_window_on_start in Windows runner#6562
FeodorFitsner merged 2 commits into
mainfrom
fix/hide-window-on-start-windows-runner

Conversation

@FeodorFitsner

@FeodorFitsner FeodorFitsner commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

The packaged Windows app showed its window on startup even when hide_window_on_start = true was set in pyproject.toml. The Dart-side setupDesktop() correctly skipped its own windowManager.show(), but the native Win32 runner (flutter_window.cpp) only consulted the FLET_HIDE_WINDOW_ON_START env var and unconditionally called Show() on the first frame, so the pyproject toggle had no effect.

Templatize the runner with the same tool.flet.<platform>.app.hide_window_on_start / tool.flet.app.hide_window_on_start lookup already used by main.dart, and OR the baked-in value with the env-var check so either source hides the window at startup.

Summary by Sourcery

Honor the hide_window_on_start configuration for packaged Windows apps by templating the Win32 runner with the pyproject setting and combining it with the existing environment variable check so the window can be hidden on startup.

The packaged Windows app showed its window on startup even when
`hide_window_on_start = true` was set in pyproject.toml. The Dart-side
`setupDesktop()` correctly skipped its own `windowManager.show()`, but
the native Win32 runner (flutter_window.cpp) only consulted the
`FLET_HIDE_WINDOW_ON_START` env var and unconditionally called `Show()`
on the first frame, so the pyproject toggle had no effect.

Templatize the runner with the same `tool.flet.<platform>.app.hide_window_on_start`
/ `tool.flet.app.hide_window_on_start` lookup already used by main.dart,
and OR the baked-in value with the env-var check so either source hides
the window at startup.

@sourcery-ai sourcery-ai Bot 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.

We've reviewed this pull request using the Sourcery rules engine

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 7, 2026

Copy link
Copy Markdown

Deploying flet-website-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 97763c8
Status: ✅  Deploy successful!
Preview URL: https://c3f6fe4f.flet-website-v2.pages.dev
Branch Preview URL: https://fix-hide-window-on-start-win.flet-website-v2.pages.dev

View logs

Add a Prerequisites section listing the apt packages required to build Flet
Linux apps (matching linux_deps.py), noting that lld is required and that the
GStreamer/mpv packages are for the Audio service and Video control.

Also document that programmatic window positioning (Page.window.center(),
left/top, move) is a no-op on Wayland (compositor-controlled) and works on
X11/XWayland, with the GDK_BACKEND=x11 workaround.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@FeodorFitsner FeodorFitsner merged commit bb993fa into main Jun 8, 2026
25 checks passed
@FeodorFitsner FeodorFitsner deleted the fix/hide-window-on-start-windows-runner branch June 8, 2026 00:05
FeodorFitsner added a commit that referenced this pull request Jun 8, 2026
Brings in build template + Windows runner fixes (#6558, #6559, #6561,
#6562) and the 0.85.3 changelog entry. Conflict in
`sdk/python/templates/build/{{cookiecutter.out_dir}}/pubspec.yaml`
resolved by keeping multi-python's `serious_python: 2.0.0` pin.
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