Index: Imakefile =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Imakefile,v retrieving revision 1.4 diff -u -r1.4 Imakefile --- Imakefile 28 Oct 2004 14:23:07 -0000 1.4 +++ Imakefile 10 Nov 2004 17:36:47 -0000 @@ -6,7 +6,9 @@ SHMDEF = -DHAS_SHM #endif +#ifdef cygwinArchitecture MMAPDEF = -DHAS_MMAP +#endif #if BuildXWinClipboard SRCS_CLIPBOARD = \ Index: InitInput.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/InitInput.c,v retrieving revision 1.3 diff -u -r1.3 InitInput.c --- InitInput.c 21 Jun 2004 13:19:32 -0000 1.3 +++ InitInput.c 10 Nov 2004 17:36:47 -0000 @@ -150,6 +150,7 @@ /* Initialize the mode key states */ winInitializeModeKeyStates (); +#ifdef __CYGWIN__ /* Only open the windows message queue device once */ if (g_fdMessageQueue == WIN_FD_INVALID) { @@ -165,6 +166,7 @@ /* Add the message queue as a device to wait for in WaitForSomething */ AddEnabledDevice (g_fdMessageQueue); } +#endif #if CYGDEBUG winDebug ("InitInput - returning\n"); Index: InitOutput.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/InitOutput.c,v retrieving revision 1.6 diff -u -r1.6 InitOutput.c --- InitOutput.c 4 Nov 2004 11:52:22 -0000 1.6 +++ InitOutput.c 10 Nov 2004 17:36:47 -0000 @@ -32,8 +32,12 @@ #include "winmsg.h" #include "winconfig.h" #include "winprefs.h" +#ifdef XWIN_CLIPBOARD #include "X11/Xlocale.h" +#endif +#ifdef __CYGWIN__ #include +#endif /* @@ -267,6 +271,7 @@ ddxGiveUp (); } +#ifdef __CYGWIN__ /* hasmntopt is currently not implemented for cygwin */ const char *winCheckMntOpt(const struct mntent *mnt, const char *opt) { @@ -349,7 +354,240 @@ if (!binary) winMsg(X_WARNING, "/tmp mounted int textmode\n"); } +#else +void +winCheckMount(void) +{ +} +#endif +static void +winFixupPaths (void) +{ + if (1) { +#ifdef __CYGWIN__ + /* Open fontpath configuration file */ + FILE *fontdirs = fopen(ETCX11DIR "/font-dirs", "rt"); + if (fontdirs != NULL) + { + char buffer[256]; + int needs_sep = TRUE; + int comment_block = FALSE; + + /* get defautl fontpath */ + char *fontpath = xstrdup(defaultFontPath); + size_t size = strlen(fontpath); + + /* read all lines */ + while (!feof(fontdirs)) + { + size_t blen; + char *hashchar; + char *str; + int has_eol = FALSE; + + /* read one line */ + str = fgets(buffer, sizeof(buffer), fontdirs); + if (str == NULL) /* stop on error or eof */ + break; + + if (strchr(str, '\n') != NULL) + has_eol = TRUE; + + /* check if block is continued comment */ + if (comment_block) + { + /* ignore all input */ + *str = 0; + blen = 0; + if (has_eol) /* check if line ended in this block */ + comment_block = FALSE; + } + else + { + /* find comment character. ignore all trailing input */ + hashchar = strchr(str, '#'); + if (hashchar != NULL) + { + *hashchar = 0; + if (!has_eol) /* mark next block as continued comment */ + comment_block = TRUE; + } + } + + /* strip whitespaces from beginning */ + while (*str == ' ' || *str == '\t') + str++; + + /* get size, strip whitespaces from end */ + blen = strlen(str); + while (blen > 0 && (str[blen-1] == ' ' || + str[blen-1] == '\t' || str[blen-1] == '\n')) + { + str[--blen] = 0; + } + + /* still something left to add? */ + if (blen > 0) + { + size_t newsize = size + blen; + /* reserve one character more for ',' */ + if (needs_sep) + newsize++; + + /* allocate memory */ + if (fontpath == NULL) + fontpath = malloc(newsize+1); + else + fontpath = realloc(fontpath, newsize+1); + + /* add separator */ + if (needs_sep) + { + fontpath[size] = ','; + size++; + needs_sep = FALSE; + } + + /* mark next line as new entry */ + if (has_eol) + needs_sep = TRUE; + + /* add block */ + strncpy(fontpath + size, str, blen); + fontpath[newsize] = 0; + size = newsize; + } + } + + /* cleanup */ + fclose(fontdirs); + defaultFontPath = xstrdup(fontpath); + free(fontpath); + winMsg (X_CONFIG, "FontPath set to \"%s\"\n", defaultFontPath); + } +#else + HMODULE module = GetModuleHandle(NULL); + char *fendptr, filename[MAX_PATH]; + const char *libx11dir = "/usr/X11R6/lib/X11"; + size_t libx11dir_len = strlen(libx11dir); + char *newfp = NULL; + size_t newfp_len = 0; + const char *endptr, *ptr, *oldptr = defaultFontPath; + + DWORD size = GetModuleFileName(module, filename, sizeof(filename)); + + fendptr = filename + size; + while (fendptr > filename) + { + if (*fendptr == '\\' || *fendptr == '/') + { + *fendptr = 0; + break; + } + fendptr--; + } + size = strlen(filename); + + endptr = oldptr + strlen(oldptr); + ptr = strchr(oldptr, ','); + if (ptr == NULL) + ptr = endptr; + while (ptr != NULL) + { + size_t oldfp_len = (ptr - oldptr); + size_t newsize = oldfp_len; + char *newpath = malloc(newsize + 1); + strncpy(newpath, oldptr, newsize); + newpath[newsize] = 0; + + + if (strncmp(libx11dir, newpath, libx11dir_len) == 0) + { + char *compose; + newsize = newsize - libx11dir_len + size; + compose = malloc(newsize + 1); + strcpy(compose, filename); + strncat(compose, newpath + libx11dir_len, newsize - size); + compose[newsize] = 0; + free(newpath); + newpath = compose; + } + + oldfp_len = newfp_len; + if (oldfp_len > 0) + newfp_len ++; /* space for separator */ + newfp_len += newsize; + + if (newfp == NULL) + newfp = malloc(newfp_len + 1); + else + newfp = realloc(newfp, newfp_len + 1); + + if (oldfp_len > 0) + { + strcpy(newfp + oldfp_len, ","); + oldfp_len++; + } + strcpy(newfp + oldfp_len, newpath); + + free(newpath); + + if (*ptr == 0) + { + oldptr = ptr; + ptr = NULL; + } else + { + oldptr = ptr + 1; + ptr = strchr(oldptr, ','); + if (ptr == NULL) + ptr = endptr; + } + } + + defaultFontPath = xstrdup(newfp); + free(newfp); + winMsg (X_DEFAULT, "FontPath set to \"%s\"\n", defaultFontPath); +#endif + } +#ifndef __CYGWIN__ + if (1) { + HMODULE module = GetModuleHandle(NULL); + char *fendptr, filename[MAX_PATH]; + const char *libx11dir = "/usr/X11R6/lib/X11"; + size_t libx11dir_len = strlen(libx11dir); + + DWORD size = GetModuleFileName(module, filename, sizeof(filename)); + + fendptr = filename + size; + while (fendptr > filename) + { + if (*fendptr == '\\' || *fendptr == '/') + { + *fendptr = 0; + break; + } + fendptr--; + } + size = strlen(filename); + + + if (strncmp(libx11dir, rgbPath, libx11dir_len) == 0) + { + size_t newsize = strlen(rgbPath) - libx11dir_len + size; + char *compose = malloc(newsize + 1); + strcpy(compose, filename); + strcat(compose, rgbPath + libx11dir_len); + compose[newsize] = 0; + rgbPath = xstrdup (compose); + free (compose); + + winMsg (X_DEFAULT, "RgbPath set to \"%s\"\n", rgbPath); + } + } +#endif +} void OsVendorInit (void) @@ -404,6 +642,8 @@ /* We have to flag this as an explicit screen, even though it isn't */ g_ScreenInfo[0].fExplicitScreen = TRUE; } + + winFixupPaths(); } Index: win.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/win.h,v retrieving revision 1.7 diff -u -r1.7 win.h --- win.h 4 Nov 2004 11:52:22 -0000 1.7 +++ win.h 10 Nov 2004 17:36:47 -0000 @@ -139,8 +139,16 @@ #include #include #include +#ifndef __CYGWIN__ +#define scprintf _scprintf +#else +extern int scprintf(const char *format, ...); +#endif + #include +#ifdef __CYGWIN__ #include +#endif #ifdef HAS_MMAP #include @@ -220,7 +228,7 @@ char *pszTemp; \ int iLength; \ \ - iLength = sprintf (NULL, str, ##__VA_ARGS__); \ + iLength = scprintf (str, ##__VA_ARGS__); \ \ pszTemp = malloc (iLength + 1); \ \ Index: winblock.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winblock.c,v retrieving revision 1.3 diff -u -r1.3 winblock.c --- winblock.c 21 Jun 2004 13:19:32 -0000 1.3 +++ winblock.c 10 Nov 2004 17:36:47 -0000 @@ -50,6 +50,11 @@ { winScreenPriv((ScreenPtr)pBlockData); MSG msg; +#ifndef __CYGWIN__ + struct timeval **tvp = pTimeout; + (*tvp)->tv_sec = 0; + (*tvp)->tv_usec = 100; +#endif #if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) /* Signal threaded modules to begin */ Index: winconfig.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winconfig.c,v retrieving revision 1.5 diff -u -r1.5 winconfig.c --- winconfig.c 28 Oct 2004 14:23:08 -0000 1.5 +++ winconfig.c 10 Nov 2004 17:36:47 -0000 @@ -737,117 +737,19 @@ MessageType from; /* Fontpath */ - from = X_DEFAULT; - if (g_cmdline.fontPath) { - from = X_CMDLINE; defaultFontPath = g_cmdline.fontPath; + winMsg (X_CMDLINE, "FontPath set to \"%s\"\n", defaultFontPath); } - else - { - /* Open fontpath configuration file */ - FILE *fontdirs = fopen(ETCX11DIR "/font-dirs", "rt"); - if (fontdirs != NULL) - { - char buffer[256]; - int needs_sep = TRUE; - int comment_block = FALSE; - - /* get defautl fontpath */ - char *fontpath = xstrdup(defaultFontPath); - size_t size = strlen(fontpath); - - /* read all lines */ - while (!feof(fontdirs)) - { - size_t blen; - char *hashchar; - char *str; - int has_eol = FALSE; - - /* read one line */ - str = fgets(buffer, sizeof(buffer), fontdirs); - if (str == NULL) /* stop on error or eof */ - break; - - if (strchr(str, '\n') != NULL) - has_eol = TRUE; - - /* check if block is continued comment */ - if (comment_block) - { - /* ignore all input */ - *str = 0; - blen = 0; - if (has_eol) /* check if line ended in this block */ - comment_block = FALSE; - } - else - { - /* find comment character. ignore all trailing input */ - hashchar = strchr(str, '#'); - if (hashchar != NULL) - { - *hashchar = 0; - if (!has_eol) /* mark next block as continued comment */ - comment_block = TRUE; - } - } - - /* strip whitespaces from beginning */ - while (*str == ' ' || *str == '\t') - str++; - - /* get size, strip whitespaces from end */ - blen = strlen(str); - while (blen > 0 && (str[blen-1] == ' ' || - str[blen-1] == '\t' || str[blen-1] == '\n')) - { - str[--blen] = 0; - } - - /* still something left to add? */ - if (blen > 0) - { - size_t newsize = size + blen; - /* reserve one character more for ',' */ - if (needs_sep) - newsize++; - - /* allocate memory */ - if (fontpath == NULL) - fontpath = malloc(newsize+1); - else - fontpath = realloc(fontpath, newsize+1); - /* add separator */ - if (needs_sep) - { - fontpath[size] = ','; - size++; - needs_sep = FALSE; - } - - /* mark next line as new entry */ - if (has_eol) - needs_sep = TRUE; - - /* add block */ - strncpy(fontpath + size, str, blen); - fontpath[newsize] = 0; - size = newsize; - } - } - - /* cleanup */ - fclose(fontdirs); - from = X_CONFIG; - defaultFontPath = xstrdup(fontpath); - free(fontpath); - } + /* RGBPath */ + if (g_cmdline.rgbPath) + { + from = X_CMDLINE; + rgbPath = g_cmdline.rgbPath; + winMsg (X_CMDLINE, "RgbPath set to \"%s\"\n", rgbPath); } - winMsg (from, "FontPath set to \"%s\"\n", defaultFontPath); return TRUE; } Index: wincreatewnd.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/wincreatewnd.c,v retrieving revision 1.5 diff -u -r1.5 wincreatewnd.c --- wincreatewnd.c 28 Oct 2004 14:23:08 -0000 1.5 +++ wincreatewnd.c 10 Nov 2004 17:36:47 -0000 @@ -419,7 +419,9 @@ #endif ) { +#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) pScreenPriv->fRootWindowShown = FALSE; +#endif ShowWindow (*phwnd, SW_HIDE); } else Index: windialogs.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/windialogs.c,v retrieving revision 1.3 diff -u -r1.3 windialogs.c --- windialogs.c 21 Jun 2004 13:19:32 -0000 1.3 +++ windialogs.c 10 Nov 2004 17:36:48 -0000 @@ -30,7 +30,9 @@ */ #include "win.h" +#ifdef __CYGWIN__ #include +#endif #include #include "winprefs.h" @@ -44,7 +46,9 @@ extern HWND g_hDlgExit; extern HWND g_hDlgAbout; extern WINPREFS pref; +#ifdef XWIN_CLIPBOARD extern Bool g_fClipboardStarted; +#endif extern Bool g_fSoftwareCursor; @@ -217,11 +221,15 @@ for (i = 1; i < currentMaxClients; i++) if (clients[i] != NullClient) liveClients++; +#if defined(XWIN_MULTIWINDOW) /* Count down server internal clients */ if (pScreenPriv->pScreenInfo->fMultiWindow) liveClients -= 2; /* multiwindow window manager & XMsgProc */ +#endif +#if defined(XWIN_CLIPBOARD) if (g_fClipboardStarted) liveClients--; /* clipboard manager */ +#endif /* A user reported that this sometimes drops below zero. just eye-candy. */ if (liveClients < 0) @@ -314,14 +322,14 @@ MAKEINTRESOURCE(IDI_XWIN))); /* Format the connected clients string */ - iReturn = sprintf (NULL, CONNECTED_CLIENTS_FORMAT, + iReturn = scprintf (CONNECTED_CLIENTS_FORMAT, s_pScreenPriv->iConnectedClients); if (iReturn <= 0) return TRUE; pszConnectedClients = malloc (iReturn + 1); if (!pszConnectedClients) return TRUE; - snprintf (pszConnectedClients, iReturn + 1, CONNECTED_CLIENTS_FORMAT, + sprintf (pszConnectedClients, CONNECTED_CLIENTS_FORMAT, s_pScreenPriv->iConnectedClients); /* Set the number of connected clients */ @@ -669,13 +677,18 @@ case ID_ABOUT_CHANGELOG: { + int iReturn; +#ifdef __CYGWIN__ const char * pszCygPath = "/usr/X11R6/share/doc/" "xorg-x11-xwin/changelog.html"; char pszWinPath[MAX_PATH + 1]; - int iReturn; /* Convert the POSIX path to a Win32 path */ cygwin_conv_to_win32_path (pszCygPath, pszWinPath); +#else + const char * pszWinPath = "http://x.cygwin.com/" + "devel/server/changelog.html"; +#endif iReturn = (int) ShellExecute (NULL, "open", Index: winerror.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winerror.c,v retrieving revision 1.4 diff -u -r1.4 winerror.c --- winerror.c 27 Jul 2004 09:53:14 -0000 1.4 +++ winerror.c 10 Nov 2004 17:36:48 -0000 @@ -43,16 +43,20 @@ void OsVendorVErrorF (const char *pszFormat, va_list va_args) { +#ifdef __CYGWIN__ static pthread_mutex_t s_pmPrinting = PTHREAD_MUTEX_INITIALIZER; /* Lock the printing mutex */ pthread_mutex_lock (&s_pmPrinting); +#endif /* Print the error message to a log file, could be stderr */ LogVWrite (0, pszFormat, va_args); +#ifdef __CYGWIN__ /* Unlock the printing mutex */ pthread_mutex_unlock (&s_pmPrinting); +#endif } #endif @@ -94,11 +98,11 @@ /* Get length of formatted error string */ va_start (args, uType); - i = sprintf (NULL, pszError, args); + i = scprintf (pszError, args); va_end (args); /* Allocate memory for formatted error string */ - pszErrorF = malloc (i); + pszErrorF = malloc (i + 1); if (!pszErrorF) goto winMessageBoxF_Cleanup; @@ -116,13 +120,13 @@ "%s\n" /* Get length of message box string */ - i = sprintf (NULL, MESSAGEBOXF, + i = scprintf (MESSAGEBOXF, pszErrorF, VENDOR_STRING, VERSION_STRING, VENDOR_CONTACT, g_pszCommandLine); /* Allocate memory for message box string */ - pszMsgBox = malloc (i); + pszMsgBox = malloc (i + 1); if (!pszMsgBox) goto winMessageBoxF_Cleanup; @@ -145,3 +149,14 @@ free (pszMsgBox); #undef MESSAGEBOXF } + +#ifdef __CYGWIN__ +extern int scprintf(const char *format, ...) +{ + int ret; + va_list va; + va_start(va, format); + ret = vsprintf(NULL, format, va); + va_end(va); +} +#endif Index: winglobals.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winglobals.c,v retrieving revision 1.3 diff -u -r1.3 winglobals.c --- winglobals.c 27 Jul 2004 09:53:14 -0000 1.3 +++ winglobals.c 10 Nov 2004 17:36:48 -0000 @@ -55,7 +55,11 @@ Bool g_fXdmcpEnabled = FALSE; HICON g_hIconX = NULL; HICON g_hSmallIconX = NULL; +#ifdef __CYGWIN__ char * g_pszLogFile = "/tmp/XWin.log"; +#else +char * g_pszLogFile = "XWin.log"; +#endif int g_iLogVerbose = 2; Bool g_fLogInited = FALSE; char * g_pszCommandLine = NULL; Index: winmultiwindowicons.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winmultiwindowicons.c,v retrieving revision 1.3 diff -u -r1.3 winmultiwindowicons.c --- winmultiwindowicons.c 21 Jun 2004 13:19:32 -0000 1.3 +++ winmultiwindowicons.c 10 Nov 2004 17:36:48 -0000 @@ -359,6 +359,7 @@ * Change the Windows window icon */ +#ifdef XWIN_MULTIWINDOW void winUpdateIcon (Window id) { @@ -471,3 +472,4 @@ !winIconIsOverride((unsigned long)hIcon)) DestroyIcon (hIcon); } +#endif Index: winprefs.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winprefs.c,v retrieving revision 1.3 diff -u -r1.3 winprefs.c --- winprefs.c 21 Jun 2004 13:19:32 -0000 1.3 +++ winprefs.c 10 Nov 2004 17:36:48 -0000 @@ -31,7 +31,9 @@ #include #include +#ifdef __CYGWIN__ #include +#endif #include "win.h" /* Fixups to prevent collisions between Windows and X headers */ @@ -281,7 +283,9 @@ g_hIconX = NULL; g_hSmallIconX = NULL; +#ifdef XWIN_MULTIWINDOW winInitGlobalIcons(); +#endif #ifdef XWIN_MULTIWINDOW /* Rebuild the icons and menus */ @@ -348,6 +352,7 @@ /* Match! */ switch(m->menuItem[j].cmd) { +#ifdef __CYGWIN__ case CMD_EXEC: if (fork()==0) { @@ -372,7 +377,7 @@ else return TRUE; break; - +#endif case CMD_ALWAYSONTOP: if (!hwnd) return FALSE; Index: winprocarg.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winprocarg.c,v retrieving revision 1.5 diff -u -r1.5 winprocarg.c --- winprocarg.c 4 Nov 2004 11:52:22 -0000 1.5 +++ winprocarg.c 10 Nov 2004 17:36:48 -0000 @@ -403,16 +403,20 @@ /* Parameter is for all screens */ for (j = 0; j < MAXSCREENS; j++) { +#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) if (!g_ScreenInfo[j].fMultiMonitorOverride) g_ScreenInfo[j].fMultipleMonitors = FALSE; +#endif g_ScreenInfo[j].fFullScreen = TRUE; } } else { /* Parameter is for a single screen */ +#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) if (!g_ScreenInfo[g_iLastScreen].fMultiMonitorOverride) g_ScreenInfo[g_iLastScreen].fMultipleMonitors = FALSE; +#endif g_ScreenInfo[g_iLastScreen].fFullScreen = TRUE; } @@ -459,16 +463,20 @@ /* Parameter is for all screens */ for (j = 0; j < MAXSCREENS; j++) { +#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) if (!g_ScreenInfo[j].fMultiMonitorOverride) g_ScreenInfo[j].fMultipleMonitors = FALSE; +#endif g_ScreenInfo[j].fDecoration = FALSE; } } else { /* Parameter is for a single screen */ +#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) if (!g_ScreenInfo[g_iLastScreen].fMultiMonitorOverride) g_ScreenInfo[g_iLastScreen].fMultipleMonitors = FALSE; +#endif g_ScreenInfo[g_iLastScreen].fDecoration = FALSE; } @@ -548,16 +556,20 @@ /* Parameter is for all screens */ for (j = 0; j < MAXSCREENS; j++) { +#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) if (!g_ScreenInfo[j].fMultiMonitorOverride) g_ScreenInfo[j].fMultipleMonitors = FALSE; +#endif g_ScreenInfo[j].fRootless = TRUE; } } else { /* Parameter is for a single screen */ +#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) if (!g_ScreenInfo[g_iLastScreen].fMultiMonitorOverride) g_ScreenInfo[g_iLastScreen].fMultipleMonitors = FALSE; +#endif g_ScreenInfo[g_iLastScreen].fRootless = TRUE; } @@ -579,16 +591,20 @@ /* Parameter is for all screens */ for (j = 0; j < MAXSCREENS; j++) { +#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) if (!g_ScreenInfo[j].fMultiMonitorOverride) g_ScreenInfo[j].fMultipleMonitors = TRUE; +#endif g_ScreenInfo[j].fMultiWindow = TRUE; } } else { /* Parameter is for a single screen */ +#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) if (!g_ScreenInfo[g_iLastScreen].fMultiMonitorOverride) g_ScreenInfo[g_iLastScreen].fMultipleMonitors = TRUE; +#endif g_ScreenInfo[g_iLastScreen].fMultiWindow = TRUE; } @@ -611,14 +627,18 @@ /* Parameter is for all screens */ for (j = 0; j < MAXSCREENS; j++) { +#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) g_ScreenInfo[j].fMultiMonitorOverride = TRUE; +#endif g_ScreenInfo[j].fMultipleMonitors = TRUE; } } else { /* Parameter is for a single screen */ +#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) g_ScreenInfo[g_iLastScreen].fMultiMonitorOverride = TRUE; +#endif g_ScreenInfo[g_iLastScreen].fMultipleMonitors = TRUE; } @@ -640,14 +660,18 @@ /* Parameter is for all screens */ for (j = 0; j < MAXSCREENS; j++) { +#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) g_ScreenInfo[j].fMultiMonitorOverride = TRUE; +#endif g_ScreenInfo[j].fMultipleMonitors = FALSE; } } else { /* Parameter is for a single screen */ +#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) g_ScreenInfo[g_iLastScreen].fMultiMonitorOverride = TRUE; +#endif g_ScreenInfo[g_iLastScreen].fMultipleMonitors = FALSE; } Index: winwndproc.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winwndproc.c,v retrieving revision 1.7 diff -u -r1.7 winwndproc.c --- winwndproc.c 6 Nov 2004 11:56:57 -0000 1.7 +++ winwndproc.c 10 Nov 2004 17:36:48 -0000 @@ -1148,8 +1148,10 @@ ShowCursor (TRUE); } +#ifdef XWIN_CLIPBOARD /* Make sure the clipboard chain is ok. */ winFixClipboardChain (); +#endif /* Call engine specific screen activation/deactivation function */ (*s_pScreenPriv->pwinActivateApp) (s_pScreen);