diff --git a/lib/extension/window.js b/lib/extension/window.js index 61820e1e..f7f58dff 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) ) ); @@ -757,7 +764,12 @@ export class WindowManager extends GObject.Object { focusNodeWindow.rect = this.tree.processGap(focusNodeWindow); } if (!focusNodeWindow.isFloat()) { - this.addFloatOverride(focusNodeWindow.nodeValue, false); + // Float this window, as Super+C does: a rule for this window only (not for its whole + // app, which was saved for good and Super+C couldn't remove), applied right away (or + // the next render tiled it again) (#469) + this.addFloatOverride(focusNodeWindow.nodeValue, true); + this.windowProps = this.ext.configMgr.windowProps; + focusNodeWindow.mode = WINDOW_MODES.FLOAT; } this.move(focusNodeWindow.nodeValue, focusNodeWindow.rect); this.queueEvent({