remove keepBelow property from Window

the value of `keepBelow` is decided by the state of window. No need to
rely on external decision.
This commit is contained in:
Eon S. Jeon 2019-02-24 04:44:33 +09:00
parent 8125f130c2
commit f1af74c928
3 changed files with 12 additions and 15 deletions

View File

@ -68,10 +68,11 @@ class TilingEngine {
);
const visibles = this.windows.filter((win) => win.visible(ctx));
const tileables = visibles.filter((win) => (win.state === WindowState.Tile));
const tiles = visibles.filter((win) =>
(win.state === WindowState.Tile) || (win.state === WindowState.FreeTile));
debugObj(() => ["arrangeScreen", {
ctx, layout,
tileables: tileables.length,
tiles: tiles.length,
visibles: visibles.length,
}]);
@ -80,17 +81,15 @@ class TilingEngine {
if (window.state === WindowState.FreeTile)
window.state = WindowState.Tile;
const isTile = (window.state === WindowState.Tile);
window.keepBelow = isTile;
window.noBorder = (CONFIG.noTileBorder) ? isTile : false;
if (window.state === WindowState.Tile)
window.noBorder = CONFIG.noTileBorder;
});
if (CONFIG.maximizeSoleTile && tileables.length === 1) {
tileables[0].keepBelow = true;
tileables[0].noBorder = true;
tileables[0].geometry = this.driver.getWorkingArea(ctx);
} else if (tileables.length > 0)
layout.apply(tileables, area, workingArea);
if (CONFIG.maximizeSoleTile && tiles.length === 1) {
tiles[0].noBorder = true;
tiles[0].geometry = this.driver.getWorkingArea(ctx);
} else if (tiles.length > 0)
layout.apply(tiles, area, workingArea);
visibles.forEach((window) => window.commit());
}

View File

@ -58,7 +58,6 @@ class Window {
public floatGeometry: Rect;
public geometry: Rect;
public noBorder: boolean;
public keepBelow: boolean;
public get state(): WindowState {
if (this.window.fullScreen)
@ -98,7 +97,6 @@ class Window {
this.floatGeometry = window.geometry;
this.geometry = window.geometry;
this.noBorder = false;
this.keepBelow = false;
this.window = window;
this._state = WindowState.Unmanaged;
@ -110,7 +108,7 @@ class Window {
public commit() {
if (this.state === WindowState.Tile)
this.window.commit(this.geometry, this.noBorder, this.keepBelow);
this.window.commit(this.geometry, this.noBorder, true);
}
public visible(ctx: IDriverContext): boolean {

View File

@ -114,7 +114,7 @@ class QuarterLayout implements ILayout {
if (tiles.length > 4)
tiles.slice(4).forEach((t) => {
t.geometry = t.floatGeometry;
t.keepBelow = false;
/* TODO: state = freetile */
});
}