mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-28 07:33:14 -04:00
Prevent ghost window from showing up on taskbar (#1977)
Add WS_EX_TOOLWINDOW to event target window
This commit is contained in:
@@ -596,7 +596,17 @@ fn create_event_target_window<T: 'static>() -> HWND {
|
||||
|
||||
unsafe {
|
||||
let window = winuser::CreateWindowExW(
|
||||
winuser::WS_EX_NOACTIVATE | winuser::WS_EX_TRANSPARENT | winuser::WS_EX_LAYERED,
|
||||
winuser::WS_EX_NOACTIVATE
|
||||
| winuser::WS_EX_TRANSPARENT
|
||||
| winuser::WS_EX_LAYERED
|
||||
// WS_EX_TOOLWINDOW prevents this window from ever showing up in the taskbar, which
|
||||
// we want to avoid. If you remove this style, this window won't show up in the
|
||||
// taskbar *initially*, but it can show up at some later point. This can sometimes
|
||||
// happen on its own after several hours have passed, although this has proven
|
||||
// difficult to reproduce. Alternatively, it can be manually triggered by killing
|
||||
// `explorer.exe` and then starting the process back up.
|
||||
// It is unclear why the bug is triggered by waiting for several hours.
|
||||
| winuser::WS_EX_TOOLWINDOW,
|
||||
THREAD_EVENT_TARGET_WINDOW_CLASS.as_ptr(),
|
||||
ptr::null_mut(),
|
||||
0,
|
||||
|
||||
Reference in New Issue
Block a user