Skip to content

Commit

Permalink
Fix error when windowId is undefined in Wayland
Browse files Browse the repository at this point in the history
This is a reimplementation of Bismuth-Forge#490
My esbuild and tsc on Debian Testing right now aren't smart enough to
convert the ?. optional chaining into something that Qt 5.15 can
understand.
  • Loading branch information
kbloom committed Dec 18, 2023
1 parent ef69afe commit 950bde8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/kwinscript/driver/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,11 @@ export class DriverWindowImpl implements DriverWindow {

public toString(): string {
// Using a shorthand name to keep debug message tidy
return `KWin(${this.client.windowId.toString(16)}.${
this.client.resourceClass
})`;
var windowIdString = 'undefined'
if (this.client.windowId) {
windowIdStirng = this.client.windowId.toString(16)
}
return `KWin(${windowIdString}.${this.client.resourceClass})`;
}

public visibleOn(surf: DriverSurface): boolean {
Expand Down

0 comments on commit 950bde8

Please sign in to comment.