From: Sergei Chernyadyev 1892-Cherser-s@users.noreply.gitlab.winehq.org
--- programs/explorer/desktop.c | 10 +++++++++- programs/explorer/explorer_private.h | 2 +- programs/explorer/systray.c | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 81eb0d1d01b..1d50fbb7034 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -1041,6 +1041,7 @@ void manage_desktop( WCHAR *arg ) MSG msg; HWND hwnd; HMODULE graphics_driver; + HMODULE remote_notification_driver; unsigned int width, height; WCHAR *cmdline = NULL, *driver = NULL; WCHAR *p = arg; @@ -1050,6 +1051,7 @@ void manage_desktop( WCHAR *arg ) HMODULE shell32; HANDLE thread; DWORD id; + void* notify_icon_ptr = NULL;
/* get the rest of the command line (if any) */ while (*p && !is_whitespace(*p)) p++; @@ -1123,7 +1125,13 @@ void manage_desktop( WCHAR *arg )
if (using_root) enable_shell = FALSE;
- initialize_systray( graphics_driver, using_root, enable_shell ); + remote_notification_driver = LoadLibraryW( L"winesni.drv" ); + if (remote_notification_driver) { + notify_icon_ptr = (void *)GetProcAddress( remote_notification_driver, "wine_notify_icon" ); + } else { + notify_icon_ptr = (void *)GetProcAddress( graphics_driver, "wine_notify_icon" ); + } + initialize_systray( notify_icon_ptr, using_root, enable_shell ); if (!using_root) initialize_launchers( hwnd );
if ((shell32 = LoadLibraryW( L"shell32.dll" )) && diff --git a/programs/explorer/explorer_private.h b/programs/explorer/explorer_private.h index 995e7eb803e..fe0a533a1ee 100644 --- a/programs/explorer/explorer_private.h +++ b/programs/explorer/explorer_private.h @@ -22,7 +22,7 @@ #define __WINE_EXPLORER_PRIVATE_H
extern void manage_desktop( WCHAR *arg ) DECLSPEC_HIDDEN; -extern void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL enable_shell ) DECLSPEC_HIDDEN; +extern void initialize_systray( void* fn_notify_icon, BOOL using_root, BOOL enable_shell ) DECLSPEC_HIDDEN; extern void initialize_appbar(void) DECLSPEC_HIDDEN; extern void handle_parent_notify( HWND hwnd, WPARAM wp ) DECLSPEC_HIDDEN; extern void do_startmenu( HWND owner ) DECLSPEC_HIDDEN; diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index 7790648d021..bdc6d2ea015 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -892,13 +892,13 @@ void handle_parent_notify( HWND hwnd, WPARAM wp ) }
/* this function creates the listener window */ -void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enable_shell ) +void initialize_systray( void* fn_notify_icon, BOOL using_root, BOOL arg_enable_shell ) { WNDCLASSEXW class; static const WCHAR classname[] = {'S','h','e','l','l','_','T','r','a','y','W','n','d',0}; RECT work_rect, primary_rect, taskbar_rect;
- if (using_root && graphics_driver) wine_notify_icon = (void *)GetProcAddress( graphics_driver, "wine_notify_icon" ); + if (using_root && fn_notify_icon) wine_notify_icon = (void *)fn_notify_icon;
icon_cx = GetSystemMetrics( SM_CXSMICON ) + 2*ICON_BORDER; icon_cy = GetSystemMetrics( SM_CYSMICON ) + 2*ICON_BORDER;