aboutsummaryrefslogtreecommitdiff
path: root/xorg-server
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server')
-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
}