From 8e7fd2df45bb84cd0763be24fa69c6c097d7acd8 Mon Sep 17 00:00:00 2001 From: "Eon S. Jeon" Date: Fri, 31 Jan 2020 03:46:40 +0900 Subject: [PATCH] keep floats above instead of tiles below (#58) --- res/config.ui | 4 ++-- res/config.xml | 2 +- src/common.ts | 4 ++-- src/driver/kwin/kwinconfig.ts | 4 ++-- src/driver/kwin/kwinwindow.ts | 8 ++++---- src/driver/test/testdriver.ts | 10 +++++----- src/engine/window.ts | 8 ++++---- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/res/config.ui b/res/config.ui index 9d8e59b..fa61d3a 100644 --- a/res/config.ui +++ b/res/config.ui @@ -552,9 +552,9 @@ Focus to Above, Below, Left, Right - + - Keep tile windows below + Keep floating windows above tiled windows diff --git a/res/config.xml b/res/config.xml index cc84076..427ad01 100644 --- a/res/config.xml +++ b/res/config.xml @@ -121,7 +121,7 @@ true - + true diff --git a/src/common.ts b/src/common.ts index e18b90b..8ca3c49 100644 --- a/src/common.ts +++ b/src/common.ts @@ -70,7 +70,7 @@ interface IConfig { //#region Features adjustLayout: boolean; adjustLayoutLive: boolean; - keepTileBelow: boolean; + keepFloatAbove: boolean; noTileBorder: boolean; //#endregion @@ -96,7 +96,7 @@ interface IDriverWindow { surface: ISurface; - commit(geometry?: Rect, noBorder?: boolean, keepBelow?: boolean): void; + commit(geometry?: Rect, noBorder?: boolean, keepAbove?: boolean): void; visible(srf: ISurface): boolean; } diff --git a/src/driver/kwin/kwinconfig.ts b/src/driver/kwin/kwinconfig.ts index 1d72e3d..d3f28a8 100644 --- a/src/driver/kwin/kwinconfig.ts +++ b/src/driver/kwin/kwinconfig.ts @@ -35,7 +35,7 @@ class KWinConfig implements IConfig { //#region Features public adjustLayout: boolean; public adjustLayoutLive: boolean; - public keepTileBelow: boolean; + public keepFloatAbove: boolean; public noTileBorder: boolean; //#endregion @@ -94,7 +94,7 @@ class KWinConfig implements IConfig { this.adjustLayout = KWin.readConfig("adjustLayout" , true); this.adjustLayoutLive = KWin.readConfig("adjustLayoutLive" , true); - this.keepTileBelow = KWin.readConfig("keepTileBelow" , true); + this.keepFloatAbove = KWin.readConfig("keepFloatAbove" , true); this.noTileBorder = KWin.readConfig("noTileBorder" , false); this.screenGapBottom = KWin.readConfig("screenGapBottom" , 0); diff --git a/src/driver/kwin/kwinwindow.ts b/src/driver/kwin/kwinwindow.ts index d283127..cfec888 100644 --- a/src/driver/kwin/kwinwindow.ts +++ b/src/driver/kwin/kwinwindow.ts @@ -91,8 +91,8 @@ class KWinWindow implements IDriverWindow { this._bakNoBorder = client.noBorder; } - public commit(geometry?: Rect, noBorder?: boolean, keepBelow?: boolean) { - debugObj(() => ["KWinWindow#commit", { geometry, noBorder, keepBelow }]); + public commit(geometry?: Rect, noBorder?: boolean, keepAbove?: boolean) { + debugObj(() => ["KWinWindow#commit", { geometry, noBorder, keepAbove }]); if (this.client.move || this.client.resize) return; @@ -100,8 +100,8 @@ class KWinWindow implements IDriverWindow { if (noBorder !== undefined) this.client.noBorder = noBorder || this._bakNoBorder; - if (keepBelow !== undefined) - this.client.keepBelow = keepBelow; + if (keepAbove !== undefined) + this.client.keepAbove = keepAbove; if (geometry !== undefined) { geometry = this.adjustGeometry(geometry); diff --git a/src/driver/test/testdriver.ts b/src/driver/test/testdriver.ts index f8010c6..7d61108 100644 --- a/src/driver/test/testdriver.ts +++ b/src/driver/test/testdriver.ts @@ -101,7 +101,7 @@ class TestWindow implements IDriverWindow { public surface: TestSurface; public fullScreen: boolean; public geometry: Rect; - public keepBelow: boolean; + public keepAbove: boolean; public noBorder: boolean; constructor(srf: TestSurface, geometry?: Rect, ignore?: boolean, float?: boolean) { @@ -114,17 +114,17 @@ class TestWindow implements IDriverWindow { this.surface = srf; this.fullScreen = false; this.geometry = geometry || new Rect(0, 0, 100, 100); - this.keepBelow = false; + this.keepAbove = false; this.noBorder = false; } - public commit(geometry?: Rect, noBorder?: boolean, keepBelow?: boolean) { + public commit(geometry?: Rect, noBorder?: boolean, keepAbove?: boolean) { if (geometry) this.geometry = geometry; if (noBorder !== undefined) this.noBorder = noBorder; - if (keepBelow !== undefined) - this.keepBelow = keepBelow; + if (keepAbove !== undefined) + this.keepAbove = keepAbove; } public focus() { diff --git a/src/engine/window.ts b/src/engine/window.ts index 9a01574..053e31c 100644 --- a/src/engine/window.ts +++ b/src/engine/window.ts @@ -127,14 +127,14 @@ class Window { public commit() { if (this.state === WindowState.Tile) - this.window.commit(this.geometry, CONFIG.noTileBorder, CONFIG.keepTileBelow); + this.window.commit(this.geometry, CONFIG.noTileBorder, false); else if (this.state === WindowState.FullTile) - this.window.commit(this.geometry, true, CONFIG.keepTileBelow); + this.window.commit(this.geometry, true, false); else if (this.state === WindowState.FloatTile && this.shouldCommitFloat) { - this.window.commit(this.floatGeometry, false, false); + this.window.commit(this.floatGeometry, false, CONFIG.keepFloatAbove); this.shouldCommitFloat = false; } else if (this.state === WindowState.Float && this.shouldCommitFloat) { - this.window.commit(this.floatGeometry, false, false); + this.window.commit(this.floatGeometry, false, CONFIG.keepFloatAbove); this.shouldCommitFloat = false; } else if (this.state === WindowState.FullScreen) this.window.commit(undefined, undefined, false);