Repository navigation
Windows: Fix transparency - #675
Merged
Merged
Conversation
francesca64
suggested changes
Oct 15, 2018
francesca64
left a comment
Member
There was a problem hiding this comment.
This works great! Besides what I've commented on, you also need a CHANGELOG entry.
| dwFlags: dwmapi::DWM_BB_ENABLE | dwmapi::DWM_BB_BLURREGION, | ||
| fEnable: 1, | ||
| hRgnBlur: ptr::null_mut(), | ||
| hRgnBlur: CreateRectRgn(0, 0, -1, -1), // makes the window transparent |
Member
There was a problem hiding this comment.
Do we need to manually free this region using DeleteObject?
| // the window is rendered properly. | ||
| let opacity = 254; | ||
|
|
||
| winuser::SetLayeredWindowAttributes(real_window.0, 0x0030c100, opacity, winuser::LWA_ALPHA); |
Member
There was a problem hiding this comment.
The meaning of the 0x0030c100 constant should be documented.
| use winapi::um::objbase::COINIT_MULTITHREADED; | ||
| use winapi::um::shobjidl_core::{CLSID_TaskbarList, ITaskbarList2}; | ||
| use winapi::um::winnt::{LONG, LPCWSTR}; | ||
| use winapi::um::wingdi::CreateRectRgn; |
Member
There was a problem hiding this comment.
Since wingdi is alphabetically before winnt, this import should be before it.
Contributor
Author
|
@francesca64 Done! |
francesca64
approved these changes
Oct 18, 2018
Member
|
Thanks! |
4 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CHANGELOG.mdif knowledge of this change could be valuable to usersFixed transparency in Windows 10 (#260). It also works with window decorations, by using
WS_EX_LAYERED. Tested with the transparency example on my Windows 10 machine.