From: Alex Henrie alexhenrie24@gmail.com
At the same time, rename the variable from desktop_nameW to desktop_titleW to avoid confusion with the configurable name of the desktop. --- programs/explorer/desktop.c | 16 +++++++++------- programs/explorer/explorer.rc | 1 + programs/explorer/resource.h | 1 + 3 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 8bed403ac4e..9f3170a844e 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -32,6 +32,7 @@
#include "wine/debug.h" #include "explorer_private.h" +#include "resource.h"
WINE_DEFAULT_DEBUG_CHANNEL(explorer);
@@ -1097,30 +1098,31 @@ static void initialize_display_settings( unsigned int width, unsigned int height
static void set_desktop_window_title( HWND hwnd, const WCHAR *name ) { - static const WCHAR desktop_nameW[] = L"Wine desktop"; static const WCHAR desktop_name_separatorW[] = L" - "; + WCHAR desktop_titleW[64]; WCHAR *window_titleW = NULL; int window_title_len;
+ LoadStringW( NULL, IDS_DESKTOP_TITLE, desktop_titleW, ARRAY_SIZE(desktop_titleW) ); + if (!name[0]) { - SetWindowTextW( hwnd, desktop_nameW ); + SetWindowTextW( hwnd, desktop_titleW ); return; }
- window_title_len = lstrlenW(name) * sizeof(WCHAR) - + sizeof(desktop_name_separatorW) - + sizeof(desktop_nameW); + window_title_len = (wcslen(name) + wcslen(desktop_titleW)) * sizeof(WCHAR) + + sizeof(desktop_name_separatorW); window_titleW = malloc( window_title_len ); if (!window_titleW) { - SetWindowTextW( hwnd, desktop_nameW ); + SetWindowTextW( hwnd, desktop_titleW ); return; }
lstrcpyW( window_titleW, name ); lstrcatW( window_titleW, desktop_name_separatorW ); - lstrcatW( window_titleW, desktop_nameW ); + lstrcatW( window_titleW, desktop_titleW );
SetWindowTextW( hwnd, window_titleW ); free( window_titleW ); diff --git a/programs/explorer/explorer.rc b/programs/explorer/explorer.rc index 1f496f7248c..e932a6080bd 100644 --- a/programs/explorer/explorer.rc +++ b/programs/explorer/explorer.rc @@ -34,6 +34,7 @@ STRINGTABLE IDS_RUN "&Run..." IDS_EXIT_LABEL "E&xit desktop" IDS_EXIT_PROMPT "Are you sure you want to close all programs and exit the virtual desktop?" + IDS_DESKTOP_TITLE "Wine Desktop" }
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL diff --git a/programs/explorer/resource.h b/programs/explorer/resource.h index 8ce62cbe962..e3bf993915b 100644 --- a/programs/explorer/resource.h +++ b/programs/explorer/resource.h @@ -27,5 +27,6 @@ #define IDS_RUN 4 #define IDS_EXIT_LABEL 5 #define IDS_EXIT_PROMPT 6 +#define IDS_DESKTOP_TITLE 7
#endif