From: Sergei Chernyadyev serg.cherniadjev@gmail.com
--- dlls/win32u/systray.c | 2 ++ include/ntuser.h | 1 + programs/explorer/systray.c | 7 +++++++ 3 files changed, 10 insertions(+)
diff --git a/dlls/win32u/systray.c b/dlls/win32u/systray.c index 67217dad634..b5fc44acdb4 100644 --- a/dlls/win32u/systray.c +++ b/dlls/win32u/systray.c @@ -52,6 +52,8 @@ LRESULT system_tray_call( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, voi case WINE_SYSTRAY_DOCK_REMOVE: return user_driver->pSystrayDockRemove( hwnd );
+ case WINE_SYSTRAY_RUN_LOOP: + return -1; default: FIXME( "Unknown NtUserSystemTrayCall msg %#x\n", msg ); break; diff --git a/include/ntuser.h b/include/ntuser.h index dd19c57221e..f794a3ba752 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -530,6 +530,7 @@ enum wine_systray_call WINE_SYSTRAY_DOCK_INSERT, WINE_SYSTRAY_DOCK_CLEAR, WINE_SYSTRAY_DOCK_REMOVE, + WINE_SYSTRAY_RUN_LOOP, };
#define WM_SYSTIMER 0x0118 diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index 1af8a72de46..428df70755e 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -1104,6 +1104,11 @@ void handle_parent_notify( HWND hwnd, WPARAM wp ) sync_taskbar_buttons(); }
+static DWORD WINAPI systray_run_loop(void* arg) +{ + return NtUserMessageCall( tray_window, WINE_SYSTRAY_RUN_LOOP, 0, 0, NULL, NtUserSystemTrayCall, FALSE ) == 0; +} + /* this function creates the listener window */ void initialize_systray( BOOL using_root, BOOL arg_enable_shell ) { @@ -1147,6 +1152,8 @@ void initialize_systray( BOOL using_root, BOOL arg_enable_shell ) tray_window = CreateWindowExW( 0, shell_traywnd_class.lpszClassName, L"", WS_CAPTION | WS_SYSMENU, CW_USEDEFAULT, CW_USEDEFAULT, size.cx, size.cy, 0, 0, 0, 0 ); NtUserMessageCall( tray_window, WINE_SYSTRAY_DOCK_INIT, 0, 0, NULL, NtUserSystemTrayCall, FALSE ); + /* run loop if SNI is being used */ + CloseHandle(CreateThread(NULL, 0, systray_run_loop, NULL, 0, NULL)); }
if (!tray_window)