1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-27 02:25:28 +03:00

windows: fix window_background_opacity

I'm not sure what exactly changed (perhaps it was a Windows updated?)
but window_background_opacity was only taking effect for windows
with no title bar.

I found that explicitly configuring a region makes transparency
work again.

refs: #553
This commit is contained in:
Wez Furlong 2021-03-21 00:54:37 -07:00
parent 2c37d2eeb5
commit f3d01c4d19
2 changed files with 13 additions and 7 deletions

View File

@ -15,6 +15,7 @@ brief notes about them may accumulate here.
* Fixed: detection and handling of fonts such as terminus-bold.otb that contain only bitmap strikes. [#560](https://github.com/wez/wezterm/issues/560)
* Fixed: the pixel size reported by the pty to the kernel wasn't adjusted for font metrics/dpi until the config was reloaded or window resized. [#563](https://github.com/wez/wezterm/issues/563)
* Fixed: greatly reduce memory consumption when system fallback fonts are loaded [#559](https://github.com/wez/wezterm/issues/559)
* Fixed: Windows: `window_background_opacity` was only taking effect when `window_decorations="NONE"` [#553](https://github.com/wez/wezterm/issues/553)
### 20210314-114017-04b7cedd

View File

@ -729,16 +729,21 @@ unsafe fn wm_ncdestroy(
fn enable_blur_behind(hwnd: HWND) {
use winapi::shared::minwindef::*;
use winapi::um::dwmapi::*;
let bb = DWM_BLURBEHIND {
dwFlags: DWM_BB_ENABLE,
fEnable: TRUE,
hRgnBlur: null_mut(),
fTransitionOnMaximized: FALSE,
};
use winapi::um::wingdi::*;
unsafe {
let region = CreateRectRgn(0, 0, -1, -1);
let bb = DWM_BLURBEHIND {
dwFlags: DWM_BB_ENABLE | DWM_BB_BLURREGION,
fEnable: TRUE,
hRgnBlur: region,
fTransitionOnMaximized: FALSE,
};
DwmEnableBlurBehindWindow(hwnd, &bb);
DeleteObject(region as _);
}
}