mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 06:11:30 +11:00
Switch to dwmapi
This commit is contained in:
parent
81314f91d8
commit
9117bcf3d3
|
@ -37,16 +37,18 @@ glutin_core_graphics = "0"
|
||||||
glutin_core_foundation = "0"
|
glutin_core_foundation = "0"
|
||||||
|
|
||||||
[target.i686-pc-windows-gnu.dependencies]
|
[target.i686-pc-windows-gnu.dependencies]
|
||||||
winapi = "0.1"
|
winapi = "~0.1.18"
|
||||||
gdi32-sys = "0.1"
|
gdi32-sys = "0.1"
|
||||||
user32-sys = "~0.1.1"
|
user32-sys = "~0.1.1"
|
||||||
kernel32-sys = "0.1"
|
kernel32-sys = "0.1"
|
||||||
|
dwmapi-sys = "0.1"
|
||||||
|
|
||||||
[target.x86_64-pc-windows-gnu.dependencies]
|
[target.x86_64-pc-windows-gnu.dependencies]
|
||||||
winapi = "0.1"
|
winapi = "~0.1.18"
|
||||||
gdi32-sys = "0.1"
|
gdi32-sys = "0.1"
|
||||||
user32-sys = "~0.1.1"
|
user32-sys = "~0.1.1"
|
||||||
kernel32-sys = "0.1"
|
kernel32-sys = "0.1"
|
||||||
|
dwmapi-sys = "0.1"
|
||||||
|
|
||||||
[target.i686-unknown-linux-gnu.dependencies]
|
[target.i686-unknown-linux-gnu.dependencies]
|
||||||
osmesa-sys = "0.0.5"
|
osmesa-sys = "0.0.5"
|
||||||
|
|
|
@ -25,6 +25,7 @@ use std::sync::mpsc::channel;
|
||||||
|
|
||||||
use winapi;
|
use winapi;
|
||||||
use kernel32;
|
use kernel32;
|
||||||
|
use dwmapi;
|
||||||
use user32;
|
use user32;
|
||||||
|
|
||||||
use api::wgl;
|
use api::wgl;
|
||||||
|
@ -223,15 +224,8 @@ unsafe fn init(title: Vec<u16>, builder: BuilderAttribs<'static>,
|
||||||
fTransitionOnMaximized: 0,
|
fTransitionOnMaximized: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
let dll = kernel32::LoadLibraryA(b"dwmapi.dll\0".as_ptr() as *const _);
|
unsafe {
|
||||||
if !dll.is_null() {
|
dwmapi::DwmEnableBlurBehindWindow(real_window.0, &bb);
|
||||||
let pr = kernel32::GetProcAddress(dll, b"DwmEnableBlurBehindWindow\0".as_ptr() as *const _);
|
|
||||||
if !pr.is_null() {
|
|
||||||
let pr: unsafe extern "system" fn(winapi::HWND, *const winapi::DWM_BLURBEHIND)
|
|
||||||
-> winapi::HRESULT = mem::transmute(pr);
|
|
||||||
pr(real_window.0, &bb);
|
|
||||||
}
|
|
||||||
kernel32::FreeLibrary(dll);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,8 @@ extern crate kernel32;
|
||||||
extern crate gdi32;
|
extern crate gdi32;
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
extern crate user32;
|
extern crate user32;
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
extern crate dwmapi;
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate objc;
|
extern crate objc;
|
||||||
|
|
Loading…
Reference in a new issue