From 0cc19716f34c4b34c97a9824c5b8aa362d16a926 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Sat, 20 Jan 2024 14:07:03 +0200 Subject: [PATCH] On Windows, Remove `WS_CAPTION`, `WS_BORDER` and `WS_EX_WINDOWEDGE` styles for child windows (#3410) --- CHANGELOG.md | 1 + src/platform_impl/windows/window_state.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac12952c..53415800 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ Unreleased` header. - **Breaking:** Rename `TouchpadMagnify` to `PinchGesture`, `SmartMagnify` to `DoubleTapGesture` and `TouchpadRotate` to `RotationGesture` to represent the action rather than the intent. - on iOS, add detection support for `PinchGesture`, `DoubleTapGesture` and `RotationGesture`. - on Windows: add `with_border_color`, `with_title_background_color`, `with_title_text_color` and `with_corner_preference` +- On Windows, Remove `WS_CAPTION`, `WS_BORDER` and `WS_EX_WINDOWEDGE` styles for child windows without decorations. # 0.29.10 diff --git a/src/platform_impl/windows/window_state.rs b/src/platform_impl/windows/window_state.rs index eeec3f4f..0a2b09dd 100644 --- a/src/platform_impl/windows/window_state.rs +++ b/src/platform_impl/windows/window_state.rs @@ -279,6 +279,12 @@ impl WindowFlags { } if self.contains(WindowFlags::CHILD) { style |= WS_CHILD; // This is incompatible with WS_POPUP if that gets added eventually. + + // Remove decorations window styles for child + if !self.contains(WindowFlags::MARKER_DECORATIONS) { + style &= !(WS_CAPTION | WS_BORDER); + style_ex &= !WS_EX_WINDOWEDGE; + } } if self.contains(WindowFlags::POPUP) { style |= WS_POPUP;