Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

gpui_windows: Check composition attribute lookup (#60122)

Richard Feldman23c0080d1dd5
diff --git a/crates/gpui_windows/src/window.rs b/crates/gpui_windows/src/window.rs
index 76075a66b1c..5a4129b493c 100644
--- a/crates/gpui_windows/src/window.rs
+++ b/crates/gpui_windows/src/window.rs
@@ -1545,8 +1545,12 @@ fn set_window_composition_attribute(hwnd: HWND, color: Option<Color>, state: u32
.log_err()
{
let func_name = PCSTR::from_raw(c"SetWindowCompositionAttribute".as_ptr() as *const u8);
+ let Some(raw_set_window_composition_attribute) = GetProcAddress(user32, func_name)
+ else {
+ return;
+ };
let set_window_composition_attribute: SetWindowCompositionAttributeType =
- std::mem::transmute(GetProcAddress(user32, func_name));
+ std::mem::transmute(raw_set_window_composition_attribute);
let mut color = color.unwrap_or_default();
let is_acrylic = state == 4;
if is_acrylic && color.3 == 0 {