explorer: Restore a per-desktop ShowSystray registry setting.
With a global fallback setting under HKCU\Software\Wine\Explorer. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56243
This commit is contained in:
parent
75b9c221b2
commit
852c4d0a8a
3 changed files with 37 additions and 6 deletions
|
@ -841,6 +841,35 @@ static BOOL get_default_enable_shell( const WCHAR *name )
|
|||
return result;
|
||||
}
|
||||
|
||||
static BOOL get_default_show_systray( const WCHAR *name )
|
||||
{
|
||||
HKEY hkey;
|
||||
BOOL found = FALSE;
|
||||
BOOL result;
|
||||
DWORD size = sizeof(result);
|
||||
|
||||
/* @@ Wine registry key: HKCU\Software\Wine\Explorer\Desktops */
|
||||
if (name && !RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Wine\\Explorer\\Desktops", &hkey ))
|
||||
{
|
||||
if (!RegGetValueW( hkey, name, L"ShowSystray", RRF_RT_REG_DWORD, NULL, &result, &size ))
|
||||
found = TRUE;
|
||||
RegCloseKey( hkey );
|
||||
}
|
||||
|
||||
/* Try again with a global Explorer setting */
|
||||
/* @@ Wine registry key: HKCU\Software\Wine\Explorer */
|
||||
if (!found && !RegOpenKeyW( HKEY_CURRENT_USER, L"Software\\Wine\\Explorer", &hkey ))
|
||||
{
|
||||
if (!RegGetValueW( hkey, NULL, L"ShowSystray", RRF_RT_REG_DWORD, NULL, &result, &size ))
|
||||
found = TRUE;
|
||||
RegCloseKey( hkey );
|
||||
}
|
||||
|
||||
/* Default on */
|
||||
if (!found) result = TRUE;
|
||||
return result;
|
||||
}
|
||||
|
||||
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";
|
||||
|
@ -1020,7 +1049,7 @@ void manage_desktop( WCHAR *arg )
|
|||
WCHAR *cmdline = NULL, *driver = NULL;
|
||||
WCHAR *p = arg;
|
||||
const WCHAR *name = NULL;
|
||||
BOOL enable_shell = FALSE;
|
||||
BOOL enable_shell = FALSE, show_systray = TRUE;
|
||||
void (WINAPI *pShellDDEInit)( BOOL ) = NULL;
|
||||
HMODULE shell32;
|
||||
HANDLE thread;
|
||||
|
@ -1054,8 +1083,8 @@ 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 );
|
||||
if (name) enable_shell = get_default_enable_shell( name );
|
||||
show_systray = get_default_show_systray( name );
|
||||
|
||||
UuidCreate( &guid );
|
||||
TRACE( "display guid %s\n", debugstr_guid(&guid) );
|
||||
|
@ -1101,7 +1130,7 @@ void manage_desktop( WCHAR *arg )
|
|||
|
||||
if (using_root) enable_shell = FALSE;
|
||||
|
||||
initialize_systray( using_root, enable_shell );
|
||||
initialize_systray( using_root, enable_shell, show_systray );
|
||||
if (!using_root) initialize_launchers( hwnd );
|
||||
|
||||
if ((shell32 = LoadLibraryW( L"shell32.dll" )) &&
|
||||
|
|
|
@ -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 );
|
||||
extern void initialize_systray( BOOL using_root, BOOL enable_shell, BOOL show_systray );
|
||||
extern void initialize_appbar(void);
|
||||
extern void handle_parent_notify( HWND hwnd, WPARAM wp );
|
||||
extern void do_startmenu( HWND owner );
|
||||
|
|
|
@ -249,6 +249,7 @@ static void balloon_create_timer( struct icon *icon )
|
|||
|
||||
static BOOL show_balloon( struct icon *icon )
|
||||
{
|
||||
if (!show_systray) return FALSE; /* systray has been hidden */
|
||||
if (icon->display == ICON_DISPLAY_HIDDEN) return FALSE; /* not displayed */
|
||||
if (!icon->info_text[0]) return FALSE; /* no balloon */
|
||||
balloon_icon = icon;
|
||||
|
@ -1114,7 +1115,7 @@ void handle_parent_notify( HWND hwnd, WPARAM wp )
|
|||
}
|
||||
|
||||
/* this function creates the listener window */
|
||||
void initialize_systray( BOOL using_root, BOOL arg_enable_shell )
|
||||
void initialize_systray( BOOL using_root, BOOL arg_enable_shell, BOOL arg_show_systray )
|
||||
{
|
||||
RECT work_rect, primary_rect, taskbar_rect;
|
||||
|
||||
|
@ -1125,6 +1126,7 @@ void initialize_systray( BOOL using_root, BOOL arg_enable_shell )
|
|||
|
||||
icon_cx = GetSystemMetrics( SM_CXSMICON ) + 2*ICON_BORDER;
|
||||
icon_cy = GetSystemMetrics( SM_CYSMICON ) + 2*ICON_BORDER;
|
||||
show_systray = arg_show_systray;
|
||||
enable_shell = arg_enable_shell;
|
||||
enable_taskbar = enable_shell || !using_root;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue