From 734dd8a4ccbd88d7a6eda9f67984ef880a804991 Mon Sep 17 00:00:00 2001 From: Peter Fajdiga Date: Tue, 19 Sep 2023 19:50:23 +0200 Subject: [PATCH] fix re-full-screen bug with Kate on Wayland --- src/layout/Window.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/layout/Window.ts b/src/layout/Window.ts index 4125e46..91d5ad1 100644 --- a/src/layout/Window.ts +++ b/src/layout/Window.ts @@ -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); } }