Skip to content

Commit

Permalink
keep floats above instead of tiles below (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
esjeon committed Jan 30, 2020
1 parent 3bfa264 commit 8e7fd2d
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions res/config.ui
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,9 @@ Focus to Above, Below, Left, Right</string>
</layout>
</item>
<item>
<widget class="QCheckBox" name="kcfg_keepTileBelow">
<widget class="QCheckBox" name="kcfg_keepFloatAbove">
<property name="text">
<string>Keep tile windows below</string>
<string>Keep floating windows above tiled windows</string>
</property>
</widget>
</item>
Expand Down
2 changes: 1 addition & 1 deletion res/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<default>true</default>
</entry>

<entry name="keepTileBelow" type="Bool">
<entry name="keepFloatAbove" type="Bool">
<label>Keep tiled windows below floating windows</label>
<default>true</default>
</entry>
Expand Down
4 changes: 2 additions & 2 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ interface IConfig {
//#region Features
adjustLayout: boolean;
adjustLayoutLive: boolean;
keepTileBelow: boolean;
keepFloatAbove: boolean;
noTileBorder: boolean;
//#endregion

Expand All @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions src/driver/kwin/kwinconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions src/driver/kwin/kwinwindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ 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;

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);
Expand Down
10 changes: 5 additions & 5 deletions src/driver/test/testdriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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() {
Expand Down
8 changes: 4 additions & 4 deletions src/engine/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8e7fd2d

Please sign in to comment.