From 1955e2a28bcdd2427efa790e7cf12800c49f00cf Mon Sep 17 00:00:00 2001 From: mattchristenson Date: Tue, 29 Sep 2026 20:00:04 -0500 Subject: [PATCH] fix: float toggle works for a second window of the same app again 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 (#534). a2fabeb (#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 #534 Co-Authored-By: Claude Opus 5.5 --- lib/extension/window.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/extension/window.js b/lib/extension/window.js index 61820e1e..24af0690 100644 --- a/lib/extension/window.js +++ b/lib/extension/window.js @@ -103,8 +103,13 @@ export class WindowManager extends GObject.Object { let wmId = metaWindow.get_id(); for (let override of overrides) { - // if the window is already floating - if (override.wmClass === wmClass && override.mode === "float" && !override.wmTitle) return; + // if the window is already floating: for Super+C only a rule for this very window counts + // (another window of the app may float already, #492), for "always float" only a rule for + // the whole app (not one that Super+C made for a single window) + if (override.wmClass === wmClass && override.mode === "float" && !override.wmTitle) { + if (withWmId ? override.wmId !== wmId : override.wmId) continue; + return; + } } overrides.push({ wmClass: wmClass, @@ -128,7 +133,9 @@ export class WindowManager extends GObject.Object { override.wmClass === wmClass && // rules with a Title are written by the user and peristent !override.wmTitle && - (!withWmId || override.wmId === wmId) + // Super+C: this window's rule; "always float": the app's rule (and this window's own), + // not the rules Super+C made for its other windows + (withWmId ? override.wmId === wmId : !override.wmId || override.wmId === wmId) ) );