Skip to content

fix: don't fold non-native fullscreen self-resizes into the layout#415

Open
KorigamiK wants to merge 1 commit into
acsandmann:mainfrom
KorigamiK:fix/non-native-fullscreen-layout-guard
Open

fix: don't fold non-native fullscreen self-resizes into the layout#415
KorigamiK wants to merge 1 commit into
acsandmann:mainfrom
KorigamiK:fix/non-native-fullscreen-layout-guard

Conversation

@KorigamiK

Copy link
Copy Markdown

Problem

Apps that implement fullscreen without macOS native fullscreen (e.g. Firefox with full-screen-api.macos-native-full-screen=false) resize their own window over the whole screen with no mouse involved. handle_window_frame_changed treats that as a user resize and emits LayoutEvent::WindowResized, which rewrites the split ratios around the window — wrecking the workspace arrangement (a BSP tree collapses into everything horizontally tiled). The damage doesn't invert when the app restores its frame on exit.

Fix

Following AeroSpace's model for non-native fullscreen: in the non-drag, same-space resize path, detect frames that cover a screen (within a ±1–2px tolerance):

  • Window resizes itself to cover the screen → ignore it for layout purposes (no WindowResized).
  • Window shrinks back from a screen-covering frame → don't fold the transition into the ratios either; instead schedule an arrange pass so the stored layout is re-asserted.
  • All other resizes behave exactly as before.

Testing

  • cargo test: 403 passed, 1 failed — the failure (topology_change_clears_stale_pending_hide_target_before_next_workspace_layout) is pre-existing and also fails on clean main at 72494bf.
  • Manually verified with Firefox non-native fullscreen: entering and leaving fullscreen now returns to the exact BSP arrangement from before, instead of a flattened horizontal tiling.

Apps implementing fullscreen without macOS native fullscreen resize
their own window over the whole screen with no mouse involved. Treating
that as a user resize rewrites split ratios and wrecks the workspace
arrangement, and the damage doesn't invert when the app restores its
frame. Following AeroSpace's model, ignore programmatic screen-covering
resizes entirely and re-assert the stored layout when the window
shrinks back.
Copilot AI review requested due to automatic review settings July 17, 2026 12:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants