temporarily disable transparancy

This commit is contained in:
Junkui Zhang 2025-07-15 12:35:33 +08:00
parent 401e0e6f41
commit 7fde34f85e

View file

@ -384,7 +384,8 @@ impl WindowsWindow {
(WS_EX_TOOLWINDOW | WS_EX_LAYERED, WINDOW_STYLE(0x0)) (WS_EX_TOOLWINDOW | WS_EX_LAYERED, WINDOW_STYLE(0x0))
} else { } else {
( (
WS_EX_APPWINDOW | WS_EX_LAYERED, // WS_EX_APPWINDOW | WS_EX_LAYERED,
WS_EX_APPWINDOW,
WS_THICKFRAME | WS_SYSMENU | WS_MAXIMIZEBOX | WS_MINIMIZEBOX, WS_THICKFRAME | WS_SYSMENU | WS_MAXIMIZEBOX | WS_MINIMIZEBOX,
) )
}; };
@ -461,7 +462,7 @@ impl WindowsWindow {
// window is going to be composited with per-pixel alpha, but the render // window is going to be composited with per-pixel alpha, but the render
// pipeline is responsible for effectively calling UpdateLayeredWindow // pipeline is responsible for effectively calling UpdateLayeredWindow
// at the appropriate time. // at the appropriate time.
unsafe { SetLayeredWindowAttributes(hwnd, COLORREF(0), 255, LWA_ALPHA)? }; // unsafe { SetLayeredWindowAttributes(hwnd, COLORREF(0), 255, LWA_ALPHA)? };
Ok(Self(state_ptr)) Ok(Self(state_ptr))
} }
@ -706,27 +707,27 @@ impl PlatformWindow for WindowsWindow {
} }
fn set_background_appearance(&self, background_appearance: WindowBackgroundAppearance) { fn set_background_appearance(&self, background_appearance: WindowBackgroundAppearance) {
let mut window_state = self.0.state.borrow_mut(); // let mut window_state = self.0.state.borrow_mut();
// todo(zjk) // todo(zjk)
// window_state // window_state
// .renderer // .renderer
// .update_transparency(background_appearance != WindowBackgroundAppearance::Opaque); // .update_transparency(background_appearance != WindowBackgroundAppearance::Opaque);
match background_appearance { // match background_appearance {
WindowBackgroundAppearance::Opaque => { // WindowBackgroundAppearance::Opaque => {
// ACCENT_DISABLED // // ACCENT_DISABLED
set_window_composition_attribute(window_state.hwnd, None, 0); // set_window_composition_attribute(window_state.hwnd, None, 0);
} // }
WindowBackgroundAppearance::Transparent => { // WindowBackgroundAppearance::Transparent => {
// Use ACCENT_ENABLE_TRANSPARENTGRADIENT for transparent background // // Use ACCENT_ENABLE_TRANSPARENTGRADIENT for transparent background
set_window_composition_attribute(window_state.hwnd, None, 2); // set_window_composition_attribute(window_state.hwnd, None, 2);
} // }
WindowBackgroundAppearance::Blurred => { // WindowBackgroundAppearance::Blurred => {
// Enable acrylic blur // // Enable acrylic blur
// ACCENT_ENABLE_ACRYLICBLURBEHIND // // ACCENT_ENABLE_ACRYLICBLURBEHIND
set_window_composition_attribute(window_state.hwnd, Some((0, 0, 0, 0)), 4); // set_window_composition_attribute(window_state.hwnd, Some((0, 0, 0, 0)), 4);
} // }
} // }
} }
fn minimize(&self) { fn minimize(&self) {