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.
This commit is contained in:
Mikhail Zolotukhin 2021-10-23 16:22:28 +03:00
parent 1d7224110b
commit 1cdf1a5bb2
4 changed files with 22 additions and 90 deletions

View File

@ -120,16 +120,6 @@
<default>false</default>
</entry>
<entry name="adjustLayout" type="Bool">
<label>Adjust layout with mouse</label>
<default>true</default>
</entry>
<entry name="adjustLayoutLive" type="Bool">
<label>Adjust as window is being resized</label>
<default>true</default>
</entry>
<entry name="keepFloatAbove" type="Bool">
<label>Keep tiled windows below floating windows</label>
<default>true</default>

View File

@ -347,62 +347,6 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="behaviorTab">
<attribute name="title">
<string>Behavior</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Layout Adjustment</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QCheckBox" name="kcfg_adjustLayout">
<property name="toolTip">
<string>Resizing window will cause layout to be adjusted. The actual behaviour might differ based on layout in use.</string>
</property>
<property name="text">
<string>Adjust layout by resizing windows</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_adjustLayoutLive">
<property name="toolTip">
<string>If enabled, resizing window will immediately adjust layout. If disabled, layout will be adjusted *after* window resizing is over.</string>
</property>
<property name="text">
<string>Adjust layout in realtime as window is being resized</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_newWindowAsMaster">
<property name="text">
<string>Put new window as master</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="rulesTab">
<attribute name="title">
<string>Rules</string>
@ -558,11 +502,18 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="optionsTab">
<widget class="QWidget" name="behaviorTab">
<attribute name="title">
<string>Options</string>
<string>Behavior</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="kcfg_newWindowAsMaster">
<property name="text">
<string>Put new window as master</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_maximizeSoleTile">
<property name="toolTip">

View File

@ -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);

View File

@ -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);
}
}