aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-02-20 17:27:12 +0000
committermarha <marha@users.sourceforge.net>2010-02-20 17:27:12 +0000
commit9cd4b45217e5624c4ffa1ad77aff87ea280db45a (patch)
treeb981bb6c191c8cee1768a3886fbb3362398f40b1
parent68504d1066c26aa26b73d5be549d7a95d6afd8ed (diff)
downloadvcxsrv-9cd4b45217e5624c4ffa1ad77aff87ea280db45a.tar.gz
vcxsrv-9cd4b45217e5624c4ffa1ad77aff87ea280db45a.tar.bz2
vcxsrv-9cd4b45217e5624c4ffa1ad77aff87ea280db45a.zip
Added command to open log file
-rw-r--r--xorg-server/hw/xwin/winprefs.c17
-rw-r--r--xorg-server/system.XWinrc15
2 files changed, 20 insertions, 12 deletions
diff --git a/xorg-server/hw/xwin/winprefs.c b/xorg-server/hw/xwin/winprefs.c
index 2472ea5aa..3becb436a 100644
--- a/xorg-server/hw/xwin/winprefs.c
+++ b/xorg-server/hw/xwin/winprefs.c
@@ -56,6 +56,8 @@ extern DWORD g_dwCurrentThreadID;
extern const char *winGetBaseDir(void);
+extern const char *g_pszLogFile;
+
/* From winmultiwindowflex.l, the real parser */
extern void parse_file (FILE *fp);
@@ -785,12 +787,9 @@ LoadPreferences (void)
/* Setup a DISPLAY environment variable, need to allocate on heap */
/* because putenv doesn't copy the argument... Always use screen 0 */
winGetDisplayName(szDisplay, 0);
- szEnvDisplay = (char *)(malloc(strlen(szDisplay)+strlen("DISPLAY=")+1));
- if (szEnvDisplay)
- {
- snprintf(szEnvDisplay, 512, "DISPLAY=%s", szDisplay);
- putenv (szEnvDisplay);
- }
+ szEnvDisplay = (char *)(malloc(strlen(szDisplay)+9/*strlen("DISPLAY=")+1*/));
+ snprintf(szEnvDisplay, 512, "DISPLAY=%s", szDisplay);
+ putenv (szEnvDisplay);
/* Replace any "%display%" in menu commands with display string */
for (i=0; i<pref.menuItems; i++)
@@ -808,6 +807,12 @@ LoadPreferences (void)
dstParam += strlen(szDisplay);
srcParam += 9;
}
+ else if (!strncmp(srcParam, "%logfile%", 9))
+ {
+ memcpy (dstParam, g_pszLogFile, strlen(g_pszLogFile));
+ dstParam += strlen(g_pszLogFile);
+ srcParam += 9;
+ }
else
{
*dstParam = *srcParam;
diff --git a/xorg-server/system.XWinrc b/xorg-server/system.XWinrc
index 15935f4e5..1d4c2b208 100644
--- a/xorg-server/system.XWinrc
+++ b/xorg-server/system.XWinrc
@@ -8,8 +8,6 @@
# Comments begin with "#" or "//" and go to the end-of-line
-# Paths to commands are **cygwin** based (i.e. /usr/local/bin/xcalc)
-
# Paths to icons are **WINDOWS** based (i.e. c:\windows\icons)
# Menus are defined as...
@@ -18,6 +16,9 @@
# ^^ This command will have any "%display%"
# string replaced with the proper display
# variable (i.e. 127.0.0.1:<display>.0)
+# (This should only rarely be needed as
+# the DISPLAY environment variable is also
+# set correctly)
# or <Menu Text> MENU <name-of-some-prior-defined-menu>
# or <Menu Text> ALWAYSONTOP
# ^^ Sets the window to display above all others
@@ -79,15 +80,17 @@
// Make some menus...
menu apps {
- xcalc exec "xcalc"
- xclock exec "xclock"
- xwininfo exec "xwininfo -pause"
+ xcalc exec "xcalc"
+ xclock exec "xclock"
+ xwininfo exec "xwininfo -pause"
}
menu root {
// Comments fit here, too...
"Reload system.XWinrc" RELOAD
- "Applications" menu apps
+ "Applications" menu apps
+ Separator
+ "Show log" exec "notepad %logfile%"
Separator
}