mirror of
https://github.com/esjeon/krohnkite.git
synced 2024-10-04 07:18:09 +03:00
make shouldIgnore/Float
into properties
This commit is contained in:
parent
c8aea2d24f
commit
b34e8474e4
@ -79,10 +79,10 @@ interface IDriverWindow {
|
||||
readonly fullScreen: boolean;
|
||||
readonly geometry: Rect;
|
||||
readonly id: string;
|
||||
readonly shouldIgnore: boolean;
|
||||
readonly shouldFloat: boolean;
|
||||
|
||||
commit(geometry?: Rect, noBorder?: boolean, keepBelow?: boolean): void;
|
||||
shouldIgnore(): boolean;
|
||||
shouldFloat(): boolean;
|
||||
visible(ctx: IDriverContext): boolean;
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,28 @@ class KWinWindow implements IDriverWindow {
|
||||
return toRect(this.client.geometry);
|
||||
}
|
||||
|
||||
public get shouldIgnore(): boolean {
|
||||
const resourceClass = String(this.client.resourceClass);
|
||||
return (
|
||||
this.client.specialWindow
|
||||
|| resourceClass === "plasmashell"
|
||||
|| (KWINCONFIG.ignoreClass.indexOf(resourceClass) >= 0)
|
||||
|| (matchWords(this.client.caption, KWINCONFIG.ignoreTitle) >= 0)
|
||||
);
|
||||
}
|
||||
|
||||
public get shouldFloat(): boolean {
|
||||
const resourceClass = String(this.client.resourceClass);
|
||||
return (
|
||||
this.client.modal
|
||||
|| (!this.client.resizeable)
|
||||
|| (KWINCONFIG.floatUtility
|
||||
&& (this.client.dialog || this.client.splash || this.client.utility))
|
||||
|| (KWINCONFIG.floatingClass.indexOf(resourceClass) >= 0)
|
||||
|| (matchWords(this.client.caption, KWINCONFIG.floatingTitle) >= 0)
|
||||
);
|
||||
}
|
||||
|
||||
private readonly _bakNoBorder: boolean;
|
||||
|
||||
constructor(client: KWin.Client) {
|
||||
@ -72,28 +94,6 @@ class KWinWindow implements IDriverWindow {
|
||||
this.client.geometry = toQRect(this.adjustGeometry(geometry));
|
||||
}
|
||||
|
||||
public shouldIgnore(): boolean {
|
||||
const resourceClass = String(this.client.resourceClass);
|
||||
return (
|
||||
this.client.specialWindow
|
||||
|| resourceClass === "plasmashell"
|
||||
|| (KWINCONFIG.ignoreClass.indexOf(resourceClass) >= 0)
|
||||
|| (matchWords(this.client.caption, KWINCONFIG.ignoreTitle) >= 0)
|
||||
);
|
||||
}
|
||||
|
||||
public shouldFloat(): boolean {
|
||||
const resourceClass = String(this.client.resourceClass);
|
||||
return (
|
||||
this.client.modal
|
||||
|| (!this.client.resizeable)
|
||||
|| (KWINCONFIG.floatUtility
|
||||
&& (this.client.dialog || this.client.splash || this.client.utility))
|
||||
|| (KWINCONFIG.floatingClass.indexOf(resourceClass) >= 0)
|
||||
|| (matchWords(this.client.caption, KWINCONFIG.floatingTitle) >= 0)
|
||||
);
|
||||
}
|
||||
|
||||
public toString(): string {
|
||||
/* using a shorthand name to keep debug message tidy */
|
||||
return "KWin(" + this.client.windowId.toString(16) + "." + this.client.resourceClass + ")";
|
||||
|
Loading…
Reference in New Issue
Block a user