fix re-full-screen bug with Kate on Wayland

This commit is contained in:
Peter Fajdiga
2023-09-19 19:50:23 +02:00
parent aeabb396f9
commit 734dd8a4cc

View File

@@ -32,12 +32,22 @@ class Window {
// window is maximized, fullscreen, or being manually resized, prevent fighting with the user
return;
}
this.client.place(x, y, width, height);
let maximized = false;
if (this.isFocused()) {
// do this here rather than in `onFocused` to ensure it happens after placement
// (otherwise placement may not happen at all)
this.client.setMaximize(this.focusedState.maximizedVertically, this.focusedState.maximizedHorizontally);
this.client.setFullScreen(this.focusedState.fullScreen);
if (this.focusedState.maximizedVertically || this.focusedState.maximizedHorizontally) {
this.client.setMaximize(this.focusedState.maximizedVertically, this.focusedState.maximizedHorizontally);
maximized = true;
}
if (this.focusedState.fullScreen) {
this.client.setFullScreen(true);
maximized = true;
}
}
if (!maximized) {
this.client.place(x, y, width, height);
}
}