mirror of
https://github.com/Bismuth-Forge/bismuth.git
synced 2024-09-17 11:37:10 +03:00
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:
parent
3f7d922fea
commit
062352e1ae
@ -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 {
|
private adjustGeometry(geometry: Rect): Rect {
|
||||||
let width = geometry.width;
|
let width = geometry.width;
|
||||||
let height = geometry.height;
|
let height = geometry.height;
|
||||||
@ -227,17 +229,6 @@ export class KWinWindow implements DriverWindow {
|
|||||||
width = this.client.geometry.width;
|
width = this.client.geometry.width;
|
||||||
height = this.client.geometry.height;
|
height = this.client.geometry.height;
|
||||||
} else {
|
} 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 */
|
/* respect min/max size limit */
|
||||||
width = clip(width, this.client.minSize.width, this.client.maxSize.width);
|
width = clip(width, this.client.minSize.width, this.client.maxSize.width);
|
||||||
height = clip(
|
height = clip(
|
||||||
@ -249,34 +240,4 @@ export class KWinWindow implements DriverWindow {
|
|||||||
|
|
||||||
return new Rect(geometry.x, geometry.y, width, height);
|
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
|
|
||||||
}
|
}
|
||||||
|
7
src/extern/kwin.d.ts
vendored
7
src/extern/kwin.d.ts
vendored
@ -253,13 +253,6 @@ declare namespace KWin {
|
|||||||
*/
|
*/
|
||||||
onAllDesktops: boolean;
|
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
|
* @see active
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user