From 08e9be0df3f02b19e39f9313fb8c7b672f772f1c Mon Sep 17 00:00:00 2001 From: kingavatar Date: Mon, 17 Apr 2023 16:38:26 +0530 Subject: [PATCH] feat: calling extendframe function to get sheet of glass effect --- window/src/os/windows/window.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/window/src/os/windows/window.rs b/window/src/os/windows/window.rs index ce53fbba3..741731d48 100644 --- a/window/src/os/windows/window.rs +++ b/window/src/os/windows/window.rs @@ -1287,7 +1287,8 @@ fn apply_theme(hwnd: HWND) -> Option { // Check for OS app theme, and set window attributes accordingly. // Note that the MS terminal app uses the logic found here for this stuff: // https://github.com/microsoft/terminal/blob/9b92986b49bed8cc41fde4d6ef080921c41e6d9e/src/interactivity/win32/windowtheme.cpp#L62 - use winapi::um::dwmapi::DwmSetWindowAttribute; + use winapi::um::dwmapi::{DwmExtendFrameIntoClientArea, DwmSetWindowAttribute}; + use winapi::um::uxtheme::MARGINS; #[allow(non_snake_case)] type WINDOWCOMPOSITIONATTRIB = u32; @@ -1374,6 +1375,16 @@ fn apply_theme(hwnd: HWND) -> Option { ); }; + DwmExtendFrameIntoClientArea( + hwnd, + &MARGINS { + cxLeftWidth: -1, + cxRightWidth: -1, + cyTopHeight: -1, + cyBottomHeight: -1, + }, + ); + if let Some(inner) = rc_from_hwnd(hwnd) { let mut inner = inner.borrow_mut();