From 28775be11574e41a2c95cab544151a1edae56ad6 Mon Sep 17 00:00:00 2001 From: Bradley Smith Date: Sat, 6 Jul 2019 10:29:15 -0700 Subject: [PATCH] Fix transparent window with decorations (#1011) * Fix transparent window with decorations * To changelog, added fix for transparent decorated windows. --- CHANGELOG.md | 1 + src/platform_impl/windows/window_state.rs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f551ec48..15d7cd2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and `WindowEvent::HoveredFile`. - On Windows, fix edge case where `RedrawRequested` could be dispatched before input events in event loop iteration. - On Windows, fix timing issue that could cause events to be improperly dispatched after `RedrawRequested` but before `EventsCleared`. - On macOS, drop unused Metal dependency. +- On Windows, fix the trail effect happening on transparent decorated windows. Borderless (or un-decorated) windows were not affected. - On Windows, fix `with_maximized` not properly setting window size to entire window. # 0.20.0 Alpha 1 diff --git a/src/platform_impl/windows/window_state.rs b/src/platform_impl/windows/window_state.rs index 8d807b54..9d494508 100644 --- a/src/platform_impl/windows/window_state.rs +++ b/src/platform_impl/windows/window_state.rs @@ -219,8 +219,9 @@ impl WindowFlags { if self.contains(WindowFlags::NO_BACK_BUFFER) { style_ex |= WS_EX_NOREDIRECTIONBITMAP; } - // if self.contains(WindowFlags::TRANSPARENT) { - // } + if self.contains(WindowFlags::TRANSPARENT) && self.contains(WindowFlags::DECORATIONS) { + style_ex |= WS_EX_LAYERED; + } if self.contains(WindowFlags::CHILD) { style |= WS_CHILD; // This is incompatible with WS_POPUP if that gets added eventually. }