aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winprefs.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/winprefs.c')
-rw-r--r--xorg-server/hw/xwin/winprefs.c44
1 files changed, 35 insertions, 9 deletions
diff --git a/xorg-server/hw/xwin/winprefs.c b/xorg-server/hw/xwin/winprefs.c
index 505292714..79f9e73f5 100644
--- a/xorg-server/hw/xwin/winprefs.c
+++ b/xorg-server/hw/xwin/winprefs.c
@@ -52,6 +52,8 @@
extern const char *winGetBaseDir(void);
+extern const char *g_pszLogFile;
+
/* From winprefslex.l, the real parser */
extern int parse_file(FILE * fp);
@@ -347,8 +349,8 @@ HandleCustomWM_COMMAND(HWND hwnd, int command)
memset(&start, 0, sizeof(start));
start.cb = sizeof(start);
- start.dwFlags = STARTF_USESHOWWINDOW;
- start.wShowWindow = SW_HIDE;
+ //start.dwFlags = STARTF_USESHOWWINDOW;
+ //start.wShowWindow = SW_HIDE;
memset(&child, 0, sizeof(child));
@@ -360,7 +362,7 @@ HandleCustomWM_COMMAND(HWND hwnd, int command)
}
else
MessageBox(NULL, m->menuItem[j].param,
- "Mingrc Exec Command Error!",
+ "VcXsrv Exec Command Error!",
MB_OK | MB_ICONEXCLAMATION);
}
return TRUE;
@@ -712,13 +714,11 @@ LoadPreferences(void)
}
/* Setup a DISPLAY environment variable, need to allocate on heap */
- /* because putenv doesn't copy the argument... */
+ /* 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++) {
@@ -732,6 +732,11 @@ 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;
dstParam++;
@@ -767,3 +772,24 @@ winOverrideStyle(char *res_name, char *res_class, char *wmName)
/* Didn't find the style, fail gracefully */
return STYLE_NONE;
}
+
+/*
+ * Check for a match of the window class to one specified in the
+ * TASKBAR{} section in the prefs file
+ */
+unsigned long
+winOverrideTaskbar(char *res_name, char *res_class, char *wmName)
+{
+ int i;
+
+ for (i=0; i<pref.taskbarItems; i++) {
+ if ((res_name && !strcmp(pref.taskbar[i].match, res_name)) ||
+ (res_class && !strcmp(pref.taskbar[i].match, res_class)) ||
+ (wmName && strstr(wmName, pref.taskbar[i].match))) {
+ if (pref.taskbar[i].type) return pref.taskbar[i].type;
+ }
+ }
+
+ /* Didn't find a taskbar type */
+ return TASKBAR_NONE;
+} \ No newline at end of file