Rémi Bernon : explorer: Create systray for the null graphics driver.

Alexandre Julliard julliard at winehq.org
Mon May 17 15:45:32 CDT 2021


Module: wine
Branch: master
Commit: 2027c8ee1fb9c47d11995ac842cb924e938589b1
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=2027c8ee1fb9c47d11995ac842cb924e938589b1

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Fri May 14 13:40:08 2021 +0200

explorer: Create systray for the null graphics driver.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/explorer/desktop.c | 20 ++++++++------------
 programs/explorer/systray.c |  2 +-
 2 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c
index 51d1535aea6..2ba276f52cb 100644
--- a/programs/explorer/desktop.c
+++ b/programs/explorer/desktop.c
@@ -959,6 +959,7 @@ void manage_desktop( WCHAR *arg )
     const WCHAR *name = NULL;
     BOOL enable_shell = FALSE;
     void (WINAPI *pShellDDEInit)( BOOL ) = NULL;
+    HMODULE shell32;
 
     /* get the rest of the command line (if any) */
     while (*p && !is_whitespace(*p)) p++;
@@ -1028,20 +1029,15 @@ void manage_desktop( WCHAR *arg )
         initialize_display_settings();
         initialize_appbar();
 
-        if (graphics_driver)
-        {
-            HMODULE shell32;
-
-            if (using_root) enable_shell = FALSE;
+        if (using_root) enable_shell = FALSE;
 
-            initialize_systray( graphics_driver, using_root, enable_shell );
-            if (!using_root) initialize_launchers( hwnd );
+        initialize_systray( graphics_driver, using_root, enable_shell );
+        if (!using_root) initialize_launchers( hwnd );
 
-            if ((shell32 = LoadLibraryW( L"shell32.dll" )) &&
-                (pShellDDEInit = (void *)GetProcAddress( shell32, (LPCSTR)188)))
-            {
-                pShellDDEInit( TRUE );
-            }
+        if ((shell32 = LoadLibraryW( L"shell32.dll" )) &&
+            (pShellDDEInit = (void *)GetProcAddress( shell32, (LPCSTR)188)))
+        {
+            pShellDDEInit( TRUE );
         }
     }
 
diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c
index 161b4b57e58..0c978451151 100644
--- a/programs/explorer/systray.c
+++ b/programs/explorer/systray.c
@@ -900,7 +900,7 @@ void initialize_systray( HMODULE graphics_driver, BOOL using_root, BOOL arg_enab
     WNDCLASSEXW class;
     static const WCHAR classname[] = {'S','h','e','l','l','_','T','r','a','y','W','n','d',0};
 
-    if (using_root) wine_notify_icon = (void *)GetProcAddress( graphics_driver, "wine_notify_icon" );
+    if (using_root && graphics_driver) wine_notify_icon = (void *)GetProcAddress( graphics_driver, "wine_notify_icon" );
 
     icon_cx = GetSystemMetrics( SM_CXSMICON ) + 2*ICON_BORDER;
     icon_cy = GetSystemMetrics( SM_CYSMICON ) + 2*ICON_BORDER;




More information about the wine-cvs mailing list