Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions lib/extension/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
)
);

Expand Down Expand Up @@ -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({
Expand Down