[PATCH 0/1] MR10011: programs/explorer: Follow up c31e65fd3bde7, keep systray visible with taskbar enabled
This is a follow-up to c31e65fd3bde71234668507a9e15780d567c0a51, which introduced a clear separation between a standalone systray window (show_systray) and the systray area embedded in the taskbar (enable_taskbar). While the standalone systray is correctly disabled when the shell taskbar is enabled, parts of the systray visibility logic still treated show_systray as a global on/off switch. As a result, WM_DISPLAYCHANGE would hide the systray entirely when show_systray was false, even though the taskbar (and its dedicated systray area) was enabled. This caused the systray and its balloons to disappear permanently after a display mode change in desktop=shell configurations. Adjust the visibility conditions so that an enabled taskbar always allows the systray to remain visible, restoring the behavior implied by c31e65fd3bde71234668507a9e15780d567c0a51 and preventing the systray from being hidden on display changes when it is embedded in the taskbar. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10011
From: Twaik Yont <9674930+twaik@users.noreply.github.com> This is a follow-up to c31e65fd3bde71234668507a9e15780d567c0a51, which introduced a clear separation between a standalone systray window (show_systray) and the systray area embedded in the taskbar (enable_taskbar). While the standalone systray is correctly disabled when the shell taskbar is enabled, parts of the systray visibility logic still treated show_systray as a global on/off switch. As a result, WM_DISPLAYCHANGE would hide the systray entirely when show_systray was false, even though the taskbar (and its dedicated systray area) was enabled. This caused the systray and its balloons to disappear permanently after a display mode change in desktop=shell configurations. Adjust the visibility conditions so that an enabled taskbar always allows the systray to remain visible, restoring the behavior implied by c31e65fd3bde71234668507a9e15780d567c0a51 and preventing the systray from being hidden on display changes when it is embedded in the taskbar. Signed-off-by: Twaik Yont <9674930+twaik@users.noreply.github.com> --- programs/explorer/systray.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index fcbceb6fda4..825c75dbe49 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -271,7 +271,7 @@ static void balloon_create_timer( struct icon *icon ) static BOOL show_balloon( struct icon *icon ) { - if (!show_systray) return FALSE; /* systray has been hidden */ + if (!enable_taskbar && !show_systray) return FALSE; /* systray has been hidden */ if (icon->display == ICON_DISPLAY_HIDDEN) return FALSE; /* not displayed */ if (!icon->info_text[0]) return FALSE; /* no balloon */ balloon_icon = icon; @@ -600,7 +600,7 @@ static void systray_add_icon( struct icon *icon ) pos = get_icon_pos( icon ); SetWindowPos( icon->window, 0, pos.x, pos.y, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_SHOWWINDOW ); - if (nb_displayed == 1 && show_systray) do_show_systray(); + if (nb_displayed == 1 && (enable_taskbar || show_systray)) do_show_systray(); TRACE( "added %u now %d icons\n", icon->id, nb_displayed ); } @@ -1105,8 +1105,7 @@ static LRESULT WINAPI shell_traywnd_proc( HWND hwnd, UINT msg, WPARAM wparam, LP return handle_incoming((HWND)wparam, (COPYDATASTRUCT *)lparam); case WM_DISPLAYCHANGE: - if (!show_systray) do_hide_systray(); - else if (!nb_displayed && !enable_taskbar) do_hide_systray(); + if (!enable_taskbar && (!show_systray || !nb_displayed)) do_hide_systray(); else do_show_systray(); break; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10011
Rémi Bernon (@rbernon) commented about programs/explorer/systray.c:
pos = get_icon_pos( icon ); SetWindowPos( icon->window, 0, pos.x, pos.y, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_SHOWWINDOW );
- if (nb_displayed == 1 && show_systray) do_show_systray(); + if (nb_displayed == 1 && (enable_taskbar || show_systray)) do_show_systray();
It's probably harmless but do we need this check? It seems to me that with `enable_taskbar` the systray does not get hidden in systray_remove_icon, so it should always be shown and by symmetry it doesn't seem to be needed here? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10011#note_128638
On Tue Feb 3 14:37:07 2026 +0000, Rémi Bernon wrote:
It's probably harmless but do we need this check? It seems to me that with `enable_taskbar` the systray does not get hidden in systray_remove_icon, so it should always be shown and by symmetry it doesn't seem to be needed here? `show_systray` is documented as `show a standalone systray window`, but in these checks it appeared to be used in the sense of `systray visible at all`, which is what led to the taskbar systray being hidden. I updated them to consistently account for `enable_taskbar` as well. This line is mainly for consistency with the other fixes; the main functional issue is in the `WM_DISPLAYCHANGE` handling.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10011#note_128667
On Tue Feb 3 16:55:54 2026 +0000, Twaik Yont wrote:
`show_systray` is documented as `show a standalone systray window`, but in these checks it appeared to be used in the sense of `systray visible at all`, which is what led to the taskbar systray being hidden. I updated them to consistently account for `enable_taskbar` as well. This line is mainly for consistency with the other fixes; the main functional issue is in the `WM_DISPLAYCHANGE` handling. Sure, but even if it seems more consistent with some area, it also is unnecessary considering the `systray_add_icon` / `systray_remove_icon` logic. With `enable_taskbar = TRUE` the systray area should *always* be visible, and doesn't need to be shown on icon addition.
It only needs to be "shown" in `WM_DISPLAYCHANGE`, but that's because we want to update its position rather than because it was hidden (and your change there looks good to me). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10011#note_128672
On Tue Feb 3 17:11:12 2026 +0000, Rémi Bernon wrote: > Sure, but even if it seems more consistent with some area, it also is > unnecessary considering the `systray_add_icon` / `systray_remove_icon` > logic. With `enable_taskbar = TRUE` the systray area should *always* be > visible, and doesn't need to be shown on icon addition. > It only needs to be "shown" in `WM_DISPLAYCHANGE`, but that's because we > want to update its position rather than because it was hidden (and your > change there looks good to me). I had some doubts so I checked it this way: 1. Start wine with `wine explorer.exe /desktop=shell,,x11` (because winewayland's desktop=shell does not work fine). 2. Invoke Run dialog or cmd.exe (to call something later because taskbar will disappear). 3. Go to Start->Control Panel->Display Settings and change virtual display resolution to anything else. 4. ... taskbar disappears ... 5. Use already opened run dialog or cmd.exe to invoke taskmgr. Taskmgr should show systray icon but it does not happen due to `show_systray` being set to 0. So I think we should keep the change. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10011#note_128674
On Tue Feb 3 17:20:52 2026 +0000, Twaik Yont wrote:
I had some doubts so I checked it this way: 1. Start wine with `wine explorer.exe /desktop=shell,,x11` (because winewayland's desktop=shell does not work fine). 2. Invoke Run dialog or cmd.exe (to call something later because taskbar will disappear). 3. Go to Start->Control Panel->Display Settings and change virtual display resolution to anything else. 4. ... taskbar disappears ... 5. Use already opened run dialog or cmd.exe to invoke taskmgr. Taskmgr should show systray icon but it does not happen due to `show_systray` being set to 0. So I think we should keep the change. Oh, sorry, I am a bit tired and missed this. In the case of calling `do_show_systray()` in `WM_DISPLAYCHANGE` handling it will be already shown. Should I remove the change?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10011#note_128675
On Tue Feb 3 17:25:54 2026 +0000, Twaik Yont wrote:
Oh, sorry, I am a bit tired and missed this. In the case of calling `do_show_systray()` in `WM_DISPLAYCHANGE` handling it will be already shown. Should I remove the change? Please yes, I think the condition is simpler without it. The MR looks good otherwise.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10011#note_128679
participants (3)
-
Rémi Bernon -
Twaik Yont -
Twaik Yont (@twaik)