From 56e94403f8f9182e05428d895a983371c7737d2a Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 9 Jan 2013 20:15:01 +0000 Subject: [PATCH] hw/xwin: Use ITaskBarList interface to ensure show-on-taskbar state is updated correctly Use ITaskBarList interface to ensure that the taskbar notices if the window has changed it's style in a way which affects if the taskbar shows it or not. Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winmultiwindowwm.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 0c6b09abb..4f6dec78b 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -614,6 +614,19 @@ UpdateStyle(WMInfoPtr pWMInfo, Window iWindow) if (zstyle == HWND_NOTOPMOST) flags |= SWP_NOZORDER | SWP_NOOWNERZORDER; SetWindowPos(hWnd, NULL, 0, 0, 0, 0, flags); + + /* + Use the WS_EX_TOOLWINDOW style to remove window from Alt-Tab window switcher + + According to MSDN, this is supposed to remove the window from the taskbar as well, + if we SW_HIDE before changing the style followed by SW_SHOW afterwards. + + But that doesn't seem to work reliably, and causes the window to flicker, so use + the iTaskbarList interface to tell the taskbar to show or hide this window. + */ + winShowWindowOnTaskbar(hWnd, + (GetWindowLongPtr(hWnd, GWL_EXSTYLE) & + WS_EX_APPWINDOW) ? TRUE : FALSE); } #if 0