From: Alex Henrie alexhenrie24@gmail.com
This setting is a more extreme version of the ShowSystray setting: In addition to suppressing the floating systray, it suppresses systray icons in the host taskbar and in the virtual desktop taskbar. NoTrayItemsDisplay is the same registry setting that can be set on Windows to remove the system tray from the taskbar, so if any application sets it, Wine will now respect the setting. --- programs/explorer/desktop.c | 23 ++++++++++++++++++++--- programs/explorer/explorer_private.h | 2 +- programs/explorer/systray.c | 7 ++++++- 3 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 54f217a4ebc..40077f6b4a9 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -960,6 +960,22 @@ static BOOL get_default_show_systray( const WCHAR *name ) return result; }
+static BOOL get_no_tray_items_display(void) +{ + BOOL result; + DWORD size = sizeof(result); + + if (!RegGetValueW( HKEY_CURRENT_USER, L"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", + L"NoTrayItemsDisplay", RRF_RT_REG_DWORD, NULL, &result, &size )) + return result; + + if (!RegGetValueW( HKEY_LOCAL_MACHINE, L"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", + L"NoTrayItemsDisplay", RRF_RT_REG_DWORD, NULL, &result, &size )) + return result; + + return FALSE; +} + static void load_graphics_driver( const WCHAR *driver, GUID *guid ) { static const WCHAR device_keyW[] = L"System\CurrentControlSet\Control\Video\{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\0000"; @@ -1144,7 +1160,7 @@ void manage_desktop( WCHAR *arg ) WCHAR *cmdline = NULL, *driver = NULL; WCHAR *p = arg; const WCHAR *name = NULL; - BOOL enable_shell = FALSE, show_systray = TRUE; + BOOL enable_shell, show_systray, no_tray_items; void (WINAPI *pShellDDEInit)( BOOL ) = NULL; HMODULE shell32; HANDLE thread; @@ -1178,8 +1194,9 @@ void manage_desktop( WCHAR *arg ) if (!get_default_desktop_size( name, &width, &height )) width = height = 0; }
- if (name) enable_shell = get_default_enable_shell( name ); + enable_shell = name ? get_default_enable_shell( name ) : FALSE; show_systray = get_default_show_systray( name ); + no_tray_items = get_no_tray_items_display();
UuidCreate( &guid ); TRACE( "display guid %s\n", debugstr_guid(&guid) ); @@ -1223,7 +1240,7 @@ void manage_desktop( WCHAR *arg ) initialize_display_settings( width, height ); initialize_appbar();
- initialize_systray( using_root, enable_shell, show_systray ); + initialize_systray( using_root, enable_shell, show_systray, no_tray_items ); 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 0639e41c9c6..10e8aa0653f 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 ); -extern void initialize_systray( BOOL using_root, BOOL enable_shell, BOOL show_systray ); +extern void initialize_systray( BOOL using_root, BOOL enable_shell, BOOL show_systray, BOOL no_tray_items ); extern void initialize_appbar(void); extern void handle_parent_notify( HWND hwnd, WPARAM wp ); extern void do_startmenu( HWND owner ); diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index 4eafa41c2a5..b5fbb32a486 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -105,6 +105,7 @@ static unsigned int nb_displayed; static BOOL enable_taskbar; /* show full taskbar, with dedicated systray area */ static BOOL show_systray; /* show a standalone systray window */ static BOOL enable_dock; /* allow systray icons to be docked in the host systray */ +static BOOL no_tray_items; /* hide the systray and all systray icons */
static int icon_cx, icon_cy, tray_width, tray_height; static int start_button_width, taskbar_button_width; @@ -628,6 +629,8 @@ static void show_icon(struct icon *icon) { TRACE( "id=0x%x, hwnd=%p\n", icon->id, icon->owner );
+ if (no_tray_items) return; + if (icon->display != ICON_DISPLAY_HIDDEN) return; /* already displayed */
if (enable_dock) @@ -1156,7 +1159,7 @@ void handle_parent_notify( HWND hwnd, WPARAM wp ) }
/* this function creates the listener window */ -void initialize_systray( BOOL arg_using_root, BOOL arg_enable_shell, BOOL arg_show_systray ) +void initialize_systray( BOOL arg_using_root, BOOL arg_enable_shell, BOOL arg_show_systray, BOOL arg_no_tray_items ) { RECT work_rect, primary_rect, taskbar_rect;
@@ -1181,6 +1184,8 @@ void initialize_systray( BOOL arg_using_root, BOOL arg_enable_shell, BOOL arg_sh enable_dock = FALSE; }
+ no_tray_items = arg_no_tray_items; + /* register the systray listener window class */ if (!RegisterClassExW( &shell_traywnd_class )) {