feat: calling extendframe function to get sheet of glass effect

This commit is contained in:
kingavatar authored and Wez Furlong committed 2023-04-17 06:33:02 -07:00
1 parent c4145a464b
commit 08e9be0df3
1 file changed
+12 -1
+12 -1
View File
@@ -1287,7 +1287,8 @@ fn apply_theme(hwnd: HWND) -> Option<LRESULT> {
// 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<LRESULT> {
);
};
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();