Skip to content

fix(desktop-window): apply bidirectional frameless/titlebar updates and clear progress bar correctly#6114

Open
ndonkoHenri wants to merge 4 commits intomainfrom
fix-window-updates
Open

fix(desktop-window): apply bidirectional frameless/titlebar updates and clear progress bar correctly#6114
ndonkoHenri wants to merge 4 commits intomainfrom
fix-window-updates

Conversation

@ndonkoHenri
Copy link
Contributor

@ndonkoHenri ndonkoHenri commented Feb 2, 2026

  • Fixes desktop window state update handling in WindowService so toggles behave correctly across repeated changes.
  • Frameless: handle both transitions (false -> true and true -> false) instead of only enabling frameless once. (fix page.window_frameless=False does not restore window chrome after frameless mode #2802)
  • Title bar buttons visibility: apply title_bar_buttons_hidden updates even when title_bar_hidden itself does not change.
  • Progress bar: allow clearing window.progress_bar by handling None/null transitions and sending native clear value (-1).

Summary by Sourcery

Improve desktop window state handling to correctly apply frameless, title bar visibility, and progress bar updates across repeated state changes.

Bug Fixes:

  • Ensure frameless window mode can be both enabled and disabled, restoring standard window chrome when frameless is turned off.
  • Apply title bar button visibility updates even when the overall title bar hidden flag does not change, keeping button state in sync with window state.
  • Allow clearing the window progress bar by handling null transitions and mapping them to the native clear value.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 2, 2026

Deploying flet-examples with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2ef1a18
Status: ✅  Deploy successful!
Preview URL: https://f02e2d06.flet-examples.pages.dev
Branch Preview URL: https://fix-window-updates.flet-examples.pages.dev

View logs

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves desktop window state synchronization in WindowService to correctly apply repeated updates for frameless mode, title bar visibility/buttons visibility, and progress bar clearing.

Changes:

  • Track and apply title_bar_buttons_hidden updates independently of title_bar_hidden changes.
  • Make frameless handling bidirectional (enable and disable).
  • Allow clearing the native progress indicator by translating null progress to -1.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +349 to +352
// Restore non-frameless window chrome
await setWindowTitleBarVisibility(
titleBarHidden ?? false,
titleBarButtonsHidden,
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

When disabling frameless mode, the restore path uses titleBarHidden ?? false, which can incorrectly force the title bar to become visible if titleBarHidden is omitted (null) but _titleBarHidden was previously true. Use the already-computed effective/cached state (e.g., _titleBarHidden ?? false) instead of defaulting to false so toggling frameless doesn’t unexpectedly change the title bar visibility.

Suggested change
// Restore non-frameless window chrome
await setWindowTitleBarVisibility(
titleBarHidden ?? false,
titleBarButtonsHidden,
// Restore non-frameless window chrome using cached state
await setWindowTitleBarVisibility(
_titleBarHidden ?? false,
_titleBarButtonsHidden,

Copilot uses AI. Check for mistakes.
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 2, 2026

Deploying flet-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2ef1a18
Status: ✅  Deploy successful!
Preview URL: https://89134c90.flet-docs.pages.dev
Branch Preview URL: https://fix-window-updates.flet-docs.pages.dev

View logs

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.

page.window_frameless=False does not restore window chrome after frameless mode

1 participant