From: Gabriel Ivăncescu gabrielopcode@gmail.com
Fixes a regression introduced by b5c57b9a62c396068d18237bd6e82b37c169fdc5, which broke the systray integration outside of virtual desktops on some DEs like XFCE.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- programs/explorer/systray.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index c76ebdd0c92..a157018d7cc 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -619,13 +619,22 @@ static BOOL show_icon(struct icon *icon)
if (icon->display != ICON_DISPLAY_HIDDEN) return TRUE; /* already displayed */
- if (!enable_taskbar && NtUserMessageCall( icon->window, WINE_SYSTRAY_DOCK_INSERT, icon_cx, icon_cy, - icon, NtUserSystemTrayCall, FALSE )) + if (!enable_taskbar) { - icon->display = ICON_DISPLAY_DOCKED; - icon->layered = TRUE; - SetWindowLongW( icon->window, GWL_EXSTYLE, GetWindowLongW( icon->window, GWL_EXSTYLE ) | WS_EX_LAYERED ); - SendMessageW( icon->window, WM_SIZE, SIZE_RESTORED, MAKELONG( icon_cx, icon_cy ) ); + DWORD old_exstyle = GetWindowLongW( icon->window, GWL_EXSTYLE ); + + /* make sure it is layered before calling into the driver */ + SetWindowLongW( icon->window, GWL_EXSTYLE, old_exstyle | WS_EX_LAYERED ); + + if (NtUserMessageCall( icon->window, WINE_SYSTRAY_DOCK_INSERT, icon_cx, icon_cy, + icon, NtUserSystemTrayCall, FALSE )) + { + icon->display = ICON_DISPLAY_DOCKED; + icon->layered = TRUE; + SendMessageW( icon->window, WM_SIZE, SIZE_RESTORED, MAKELONG( icon_cx, icon_cy ) ); + } + else + SetWindowLongW( icon->window, GWL_EXSTYLE, old_exstyle ); } systray_add_icon( icon );