You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a small toy program that uses OpenGL (via glutin) in a non-decorated, transparent window to display some graphics. Starting with v0.24.0 the windows is no longer fully transparent. In the image below, the left side is with winit 0.23, and the right side with 0.24.
I identified #1621 as the culprit, reverting this commit fixes the issue for me, but I don't know Windows well enough to know why that is.
The text was updated successfully, but these errors were encountered:
* Restore the ability to have fully transparent windows on Windows
Besides its original purpose, commit 6343059 "Fix Windows transparency
behavior to support fully-opaque regions (#1621)" also included some
changes considered cleanups, one of them was:
* Remove the `CreateRectRgn` call, since we want the entire window's region to
have blur behind it, and `DwnEnableBlurBehindWindow` does that by default.
But the original code actually disabled the blur effect for the whole
window by creating an empty region for it, because that allows for the
window to be truely fully transparent. With the blur effect in place,
the areas meant to be transparent either blur the things behind it
(until Windows 8) or are darkened (since Windows 8). This also means
that on Windows 8 and newer, the resulting colors are darker than
intended in translucent areas when the blur effect is enabled.
This restores the behaviour from winit <0.24 and fixes#1814.
Arguably, one might want to expose the ability to control the blur
region, but that is outside the scope of this commit.
* Remove useless WS_EX_LAYERED from transparent windows on Windows
`WS_EX_LAYERED` is not supposed to be used in combination with
`CS_OWNDC`. In winit, as it is currently used, `WS_EX_LAYERED` actually
has no effect at all. The only relevant call is to
`SetLayeredWindowAttributes`, which is required to make the window
visible at all with `WS_EX_LAYERED` set, but is called with full
opacity, i.e. there's no transparency involved at all.
The actual transparency is already achieved by using
`DwmEnableBlurBehindWindow`, so `WS_EX_LAYERED` and the call to
`SetLayeredWindowAttributes` can both be removed.
I have a small toy program that uses OpenGL (via glutin) in a non-decorated, transparent window to display some graphics. Starting with v0.24.0 the windows is no longer fully transparent. In the image below, the left side is with winit 0.23, and the right side with 0.24.
I identified #1621 as the culprit, reverting this commit fixes the issue for me, but I don't know Windows well enough to know why that is.
The text was updated successfully, but these errors were encountered: