From 69ae847273aa2b0a64bdb07cf19d3f6fbaaa6b71 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 8 Apr 2023 11:24:25 -0700 Subject: [PATCH] windows: fix: mess up full screen mode on config reload refs: https://github.com/wez/wezterm/issues/3439 --- docs/changelog.md | 2 ++ window/src/os/windows/window.rs | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index f8e0d050187..41b3f986f10 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -135,6 +135,8 @@ As features stabilize some brief notes about them will accumulate here. * Wayland: window not repainting consistently when using the keyboard when using `front_end="WebGpu"`. Thanks to @jokeyrhyme for working through different iterations of this fix! #3126 +* Windows: reloading the config could partially knock the window out of + full screen mode. #3439 ### 20230326-111934-3666303c diff --git a/window/src/os/windows/window.rs b/window/src/os/windows/window.rs index 125992f6571..6bb6f88fcaf 100644 --- a/window/src/os/windows/window.rs +++ b/window/src/os/windows/window.rs @@ -306,6 +306,16 @@ fn schedule_apply_decoration(hwnd: HWND, decorations: WindowDecorations) { } fn apply_decoration_immediate(hwnd: HWND, decorations: WindowDecorations) { + match rc_from_hwnd(hwnd) { + Some(inner) => { + if inner.borrow().saved_placement.is_some() { + // We are full screen; ignore it for now + return; + } + } + None => return, + }; + unsafe { let orig_style = GetWindowLongW(hwnd, GWL_STYLE); let style = decorations_to_style(decorations);