pass output to Workspace.clientArea
This commit is contained in:
6
src/extern/kwin.d.ts
vendored
6
src/extern/kwin.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user