Skip to content

fix: float toggle works for a second window of the same app again - #573

Open
mattchristenson wants to merge 1 commit into
forge-ext:mainfrom
Reliable-Collaboration:fix/float-toggle-per-window
Open

mattchristenson wants to merge 1 commit into
forge-ext:mainfrom
Reliable-Collaboration:fix/float-toggle-per-window

Conversation

@mattchristenson

Copy link
Copy Markdown

Fixes #534. See also #495 (the same report in a comment) and #492, which was fixed for this before.

Problem. Super+C (FloatToggle) floats a window by adding a float rule for that window only (wmId) to the window overrides. addFloatOverride() returns early if any float rule for the same app already exists. So once one Text Editor window floats, Super+C on a second Text Editor window finds the first window's rule and does nothing. a2fabeb (for #492) had fixed this by skipping rules for other windows. b504512 (live resize) rewrote the function and lost that check.

Change. Restore the check, and make it symmetric:

  • for Super+C (a rule for one window), only a rule for this window means it floats already; rules for other windows of the same app are skipped (the Cannot toggle window floating #492 fix);
  • for "always float" (Super+Shift+C, a rule for the whole app), only an app-wide rule counts. A rule that Super+C made for a single window is skipped. Otherwise the app rule was never saved, and the window tiled again at the next layout.
  • removing works the same way: turning "always float" off removes the app's rule (and this window's own), but not the rules Super+C made for the app's other windows, which stay floating.

Testing. Scenario scenarios/20_float_toggle.py:

  • 20.1–20.4: Super+C on and off, on two Text Editor windows in turn;
  • 20.5: "always float" on the second after Super+C on the first;
  • 20.6: "always float" off again, where the first window stays floating.

main 1/6 (only the first Super+C works) → 6/6. The rest of the suite is unchanged against main. It was also run on a build together with the other open PRs, in the sandbox and in a real GNOME Shell 50 session. prettier@2.7.1 --check is clean.

🤖 Generated with Claude Code

addFloatOverride() returned early if any float rule for the window's app
existed, so once one window of an app floated through Super+C, Super+C on a
second window of that app did nothing (forge-ext#534). a2fabeb (forge-ext#492) had fixed this by
skipping other windows' rules; b504512 lost that check.

Restore it, and match rules to the kind of toggle on both sides: Super+C adds
and removes only this window's rule; "always float" adds and removes the
app's rule (and this window's own), never the rules Super+C made for the
app's other windows.

Fixes forge-ext#534

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Bug: Cannot float

1 participant