fix(wayland): 🔥 remove basicUnit and its usages

I honestly do not understand why is this needed, but it prevents running
script on Wayland session entierly. In the docs this parameter is marked
as unreliable anyway and we do not want to support non-crossplatform
features.

This will surely break something. I do not know what and when.
This commit is contained in:
Mikhail Zolotukhin 2021-09-22 19:04:50 +03:00
parent 3f7d922fea
commit 062352e1ae
2 changed files with 5 additions and 51 deletions

View File

@ -215,9 +215,11 @@ export class KWinWindow implements DriverWindow {
);
}
//#region Private Methods
/** apply various resize hints to the given geometry */
/**
* Apply various resize hints to the given geometry
* @param geometry
* @returns
*/
private adjustGeometry(geometry: Rect): Rect {
let width = geometry.width;
let height = geometry.height;
@ -227,17 +229,6 @@ export class KWinWindow implements DriverWindow {
width = this.client.geometry.width;
height = this.client.geometry.height;
} else {
/* respect resize increment */
if (
!(
this.client.basicUnit.width === 1 &&
this.client.basicUnit.height === 1
)
) {
/* NOT free-size */
[width, height] = this.applyResizeIncrement(geometry);
}
/* respect min/max size limit */
width = clip(width, this.client.minSize.width, this.client.maxSize.width);
height = clip(
@ -249,34 +240,4 @@ export class KWinWindow implements DriverWindow {
return new Rect(geometry.x, geometry.y, width, height);
}
private applyResizeIncrement(geom: Rect): [number, number] {
const unit = this.client.basicUnit;
const base = this.client.minSize;
const padWidth = this.client.geometry.width - this.client.clientSize.width;
const padHeight =
this.client.geometry.height - this.client.clientSize.height;
const quotWidth = Math.floor(
(geom.width - base.width - padWidth) / unit.width
);
const quotHeight = Math.floor(
(geom.height - base.height - padHeight) / unit.height
);
const newWidth = base.width + unit.width * quotWidth + padWidth;
const newHeight = base.height + unit.height * quotHeight + padHeight;
// debugObj(() => ["applyResizeIncrement", {
// // tslint:disable-next-line:object-literal-sort-keys
// unit, base, geom,
// pad: [padWidth, padHeight].join("x"),
// size: [newWidth, newHeight].join("x"),
// }]);
return [newWidth, newHeight];
}
//#endregion
}

View File

@ -253,13 +253,6 @@ declare namespace KWin {
*/
onAllDesktops: boolean;
/**
* By how much the window wishes to grow/shrink at least. Usually QSize(1,1).
* MAY BE DISOBEYED BY THE WM! It's only for information, do NOT rely on it at all.
* WARNING: X11 only. Needs to be replaced in Bismuth in order to support Wayland
*/
basicUnit: QSize;
/**
* @see active
*/