From 1cdf1a5bb22d7d323d0a242253f4e88216d251dc Mon Sep 17 00:00:00 2001 From: Mikhail Zolotukhin Date: Sat, 23 Oct 2021 16:22:28 +0300 Subject: [PATCH] feat!: remove adjustLayout options These options should be always enabled by default, because this is how all tiling window managers work: mouse resize always has feedback and resizing always affects the layout. BREAKING CHANGE: all the users, that have these options disabled will now have the default behavior - dynamic reacting to the window resize events. --- res/config/main.xml | 10 ------ res/ui/config.ui | 67 ++++++----------------------------------- src/config.ts | 9 ------ src/controller/index.ts | 26 ++++++++-------- 4 files changed, 22 insertions(+), 90 deletions(-) diff --git a/res/config/main.xml b/res/config/main.xml index c7d6dd6c..8a9a7339 100644 --- a/res/config/main.xml +++ b/res/config/main.xml @@ -120,16 +120,6 @@ false - - - true - - - - - true - - true diff --git a/res/ui/config.ui b/res/ui/config.ui index f5091eec..643d0991 100644 --- a/res/ui/config.ui +++ b/res/ui/config.ui @@ -347,62 +347,6 @@ - - - Behavior - - - - - - Layout Adjustment - - - - - - Resizing window will cause layout to be adjusted. The actual behaviour might differ based on layout in use. - - - Adjust layout by resizing windows - - - - - - - If enabled, resizing window will immediately adjust layout. If disabled, layout will be adjusted *after* window resizing is over. - - - Adjust layout in realtime as window is being resized - - - - - - - - - - Put new window as master - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - Rules @@ -558,11 +502,18 @@ - + - Options + Behavior + + + + Put new window as master + + + diff --git a/src/config.ts b/src/config.ts index 1c3d8ccf..9d901858 100644 --- a/src/config.ts +++ b/src/config.ts @@ -29,8 +29,6 @@ export interface Config { //#endregion //#region Features - adjustLayout: boolean; - adjustLayoutLive: boolean; keepFloatAbove: boolean; noTileBorder: boolean; limitTileWidthRatio: number; @@ -84,8 +82,6 @@ export class ConfigImpl implements Config { //#endregion //#region Features - public adjustLayout: boolean; - public adjustLayoutLive: boolean; public keepFloatAbove: boolean; public noTileBorder: boolean; public limitTileWidthRatio: number; @@ -179,11 +175,6 @@ export class ConfigImpl implements Config { false ); - this.adjustLayout = this.kwinApi.KWin.readConfig("adjustLayout", true); - this.adjustLayoutLive = this.kwinApi.KWin.readConfig( - "adjustLayoutLive", - true - ); this.keepFloatAbove = this.kwinApi.KWin.readConfig("keepFloatAbove", true); this.noTileBorder = this.kwinApi.KWin.readConfig("noTileBorder", false); diff --git a/src/controller/index.ts b/src/controller/index.ts index aec4643a..9ec189a2 100644 --- a/src/controller/index.ts +++ b/src/controller/index.ts @@ -298,23 +298,23 @@ export class ControllerImpl implements Controller { /* do nothing */ } - public onWindowResize(window: EngineWindow): void { - this.log.log(["onWindowResize", { window }]); - if (this.config.adjustLayout && this.config.adjustLayoutLive) { - if (window.state === WindowState.Tiled) { - this.engine.adjustLayout(window); - this.engine.arrange(); - } + public onWindowResize(win: EngineWindow): void { + this.log.log(`[Controller#onWindowResize] Window is resizing: ${win}`); + + if (win.state === WindowState.Tiled) { + this.engine.adjustLayout(win); + this.engine.arrange(); } } - public onWindowResizeOver(window: EngineWindow): void { - this.log.log(["onWindowResizeOver", { window }]); - if (this.config.adjustLayout && window.tiled) { - this.engine.adjustLayout(window); + public onWindowResizeOver(win: EngineWindow): void { + this.log.log( + `[Controller#onWindowResizeOver] Window resize is over: ${win}` + ); + + if (win.tiled) { + this.engine.adjustLayout(win); this.engine.arrange(); - } else if (!this.config.adjustLayout) { - this.engine.enforceSize(window); } }