ClientWrapper: don't try to maximize/fullscreenify unsupporting windows

This commit is contained in:
Peter Fajdiga
2024-03-10 15:52:22 +01:00
parent 67d4d89700
commit 02db31266b
2 changed files with 11 additions and 0 deletions

View File

@@ -55,6 +55,8 @@ interface KwinClient {
readonly move: boolean;
readonly resize: boolean;
readonly resizeable: boolean;
readonly fullScreenable: boolean;
readonly maximizable: boolean;
readonly output: Output;
readonly resourceClass: QByteArray;
readonly dock: boolean;

View File

@@ -80,6 +80,10 @@ class ClientWrapper {
}
public setMaximize(horizontally: boolean, vertically: boolean) {
if (!this.kwinClient.maximizable) {
return;
}
if (this.maximizedMode === undefined) {
if (horizontally && vertically) {
this.maximizedMode = MaximizedMode.Maximized;
@@ -91,12 +95,17 @@ class ClientWrapper {
this.maximizedMode = MaximizedMode.Unmaximized;
}
}
this.manipulatingGeometry.do(() => {
this.kwinClient.setMaximize(vertically, horizontally);
});
}
public setFullScreen(fullScreen: boolean) {
if (!this.kwinClient.fullScreenable) {
return;
}
this.manipulatingGeometry.do(() => {
this.kwinClient.fullScreen = fullScreen;
});