diff --git a/src/extern/kwin.d.ts b/src/extern/kwin.d.ts index 0be7d43..8638303 100644 --- a/src/extern/kwin.d.ts +++ b/src/extern/kwin.d.ts @@ -7,6 +7,7 @@ declare const Workspace: { readonly desktops: KwinDesktop[]; readonly currentDesktop: KwinDesktop; readonly currentActivity: string; + readonly activeScreen: Output; readonly windows: KwinClient[]; activeWindow: KwinClient; @@ -20,7 +21,7 @@ declare const Workspace: { readonly currentActivityChanged: QSignal<[]>; readonly virtualScreenSizeChanged: QSignal<[]>; - clientArea(option: ClientAreaOption, screenNumber: number, desktopNumber: number); + clientArea(option: ClientAreaOption, output: Output, desktopNumber: number); }; const enum ClientAreaOption { @@ -35,6 +36,7 @@ const enum ClientAreaOption { } type Tile = unknown; +type Output = unknown; interface KwinClient { readonly shadeable: boolean; @@ -45,7 +47,7 @@ interface KwinClient { readonly move: boolean; readonly resize: boolean; readonly resizeable: boolean; - readonly screen: number; // TODO: Remove + readonly output: Output; readonly resourceClass: QByteArray; readonly dock: boolean; readonly normalWindow: boolean; diff --git a/src/layout/Desktop.ts b/src/layout/Desktop.ts index 3949dda..66c4122 100644 --- a/src/layout/Desktop.ts +++ b/src/layout/Desktop.ts @@ -38,7 +38,7 @@ class Desktop { } private static getClientArea(kwinDesktop: KwinDesktop) { - return Workspace.clientArea(ClientAreaOption.PlacementArea, 0, 0); // TODO: pass desktop + return Workspace.clientArea(ClientAreaOption.PlacementArea, Workspace.activeScreen, 0); // TODO: pass desktop } private static getTilingArea(clientArea: QmlRect, kwinDesktop: KwinDesktop, pinManager: PinManager, config: Desktop.Config) { diff --git a/src/world/Clients.ts b/src/world/Clients.ts index e5008b9..636019b 100644 --- a/src/world/Clients.ts +++ b/src/world/Clients.ts @@ -20,12 +20,12 @@ namespace Clients { } export function isMaximizedGeometry(kwinClient: KwinClient) { - const maximizeArea = Workspace.clientArea(ClientAreaOption.MaximizeArea, kwinClient.screen, 0); // TODO: pass desktop + const maximizeArea = Workspace.clientArea(ClientAreaOption.MaximizeArea, kwinClient.output, 0); // TODO: pass desktop return kwinClient.frameGeometry === maximizeArea; } export function isFullScreenGeometry(kwinClient: KwinClient) { - const fullScreenArea = Workspace.clientArea(ClientAreaOption.FullScreenArea, kwinClient.screen, 0); // TODO: pass desktop + const fullScreenArea = Workspace.clientArea(ClientAreaOption.FullScreenArea, kwinClient.output, 0); // TODO: pass desktop return kwinClient.frameGeometry === fullScreenArea; } diff --git a/src/world/clientState/Floating.ts b/src/world/clientState/Floating.ts index 9157587..631824c 100644 --- a/src/world/clientState/Floating.ts +++ b/src/world/clientState/Floating.ts @@ -24,7 +24,7 @@ namespace ClientState { } private static limitHeight(client: ClientWrapper) { - const placementArea = Workspace.clientArea(ClientAreaOption.PlacementArea, client.kwinClient.screen, 0); // TODO: pass desktop + const placementArea = Workspace.clientArea(ClientAreaOption.PlacementArea, client.kwinClient.output, 0); // TODO: pass desktop const clientRect = client.kwinClient.frameGeometry; const width = client.preferredWidth; client.place(