From: Sergei Chernyadyev 1892-Cherser-s@users.noreply.gitlab.winehq.org
--- 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 3a62fa7c986..1df2b97da9a 100644 --- a/dlls/win32u/systray.c +++ b/dlls/win32u/systray.c @@ -61,6 +61,8 @@ LRESULT system_tray_call( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, voi case WINE_SYSTRAY_SHOW_BALLOON: return user_driver->pSystrayShowBalloon( hwnd, wparam, lparam, data );
+ 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 d188c7bb92c..9fabefeae62 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -534,6 +534,7 @@ enum wine_systray_call WINE_SYSTRAY_DOCK_CLEAR, WINE_SYSTRAY_DOCK_REMOVE, WINE_SYSTRAY_SHOW_BALLOON, + WINE_SYSTRAY_RUN_LOOP, };
struct systray_balloon diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index 9da95af6bac..178efe942a2 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -1144,6 +1144,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 ) { @@ -1180,6 +1185,8 @@ void initialize_systray( BOOL using_root, BOOL arg_enable_shell ) tray_window = CreateWindowExW( WS_EX_NOACTIVATE, shell_traywnd_class.lpszClassName, NULL, WS_POPUP, taskbar_rect.left, taskbar_rect.top, taskbar_rect.right - taskbar_rect.left, taskbar_rect.bottom - taskbar_rect.top, 0, 0, 0, 0 ); + /* run loop if SNI is being used */ + CloseHandle(CreateThread(NULL, 0, systray_run_loop, NULL, 0, NULL)); } else {