Commit 9826b838 authored by Alexander Gottwald's avatar Alexander Gottwald

Bufzilla #1802, http://freedesktop.org/bugzilla/show_bug.cgi?id=1802 Added

    mingw (Win32) port
parent cecb6681
2004-11-15 Alexander Gottwald <ago at freedesktop dot org>
* indirect.c:
Bufzilla #1802, http://freedesktop.org/bugzilla/show_bug.cgi?id=1802
Added mingw (Win32) port
2004-08-13 Alexander Gottwald <ago@freedesktop.org> 2004-08-13 Alexander Gottwald <ago@freedesktop.org>
* Imakefile: Added $(MESASRCDIR)/src/mesa/glapi to INCLUDES. * Imakefile: Added $(MESASRCDIR)/src/mesa/glapi to INCLUDES.
......
...@@ -44,8 +44,9 @@ ...@@ -44,8 +44,9 @@
#include "glwindows.h" #include "glwindows.h"
#include <glcontextmodes.h> #include <glcontextmodes.h>
#include <stdint.h>
#include "../../hw/xwin/winpriv.h" #include <winpriv.h>
#define GLWIN_DEBUG_HWND(hwnd) \ #define GLWIN_DEBUG_HWND(hwnd) \
if (glWinDebugSettings.dumpHWND) { \ if (glWinDebugSettings.dumpHWND) { \
......
2004-11-15 Alexander Gottwald <ago at freedesktop dot org>
* Imakefile:
* InitInput.c: (InitInput):
* InitOutput.c: (winClipboardShutdown), (ddxGiveUp),
(winCheckMount), (winGetBaseDir), (winFixupPaths), (OsVendorInit),
(winCheckDisplayNumber):
* win.h:
* winblock.c: (winBlockHandler):
* winclipboard.h:
* winclipboardthread.c: (winClipboardProc):
* winclipboardwndproc.c: (winClipboardWindowProc):
* winconfig.c: (winConfigKeyboard), (winConfigFiles):
* wincreatewnd.c: (winCreateBoundingWindowWindowed):
* windialogs.c: (winDisplayExitDialog), (winExitDlgProc),
(winAboutDlgProc):
* winengine.c: (winSetEngine):
* winerror.c: (OsVendorVErrorF), (winMessageBoxF), (scprintf):
* winglobals.c: (winInitializeGlobals):
* winkeybd.c: (winKeybdReleaseKeys):
* winmultiwindowicons.c:
* winmultiwindowwindow.c: (winCreateWindowsWindow):
* winmultiwindowwm.c:
* winprefs.c: (ReloadPrefs), (HandleCustomWM_COMMAND):
* winprocarg.c: (ddxProcessArgument):
* winscrinit.c: (winFinishScreenInitFB):
* winshadddnl.c:
* wintrayicon.c: (winHandleIconMessage):
* winwakeup.c: (winWakeupHandler):
* winwin32rootless.c: (winMWExtWMCreateFrame):
* winwindow.c: (winReshapeRootless):
* winwindow.h:
* winwndproc.c: (winWindowProc):
Bufzilla #1802, http://freedesktop.org/bugzilla/show_bug.cgi?id=1802
Added mingw (Win32) port
2004-11-06 Alexander Gottwald <ago at freedesktop dot org> 2004-11-06 Alexander Gottwald <ago at freedesktop dot org>
* winwndproc.c, wintrayicon.c, winscrinit.c: * winwndproc.c, wintrayicon.c, winscrinit.c:
......
...@@ -57,7 +57,9 @@ CARD32 g_c32LastInputEventTime = 0; ...@@ -57,7 +57,9 @@ CARD32 g_c32LastInputEventTime = 0;
* References to external symbols * References to external symbols
*/ */
#ifdef HAS_DEVWINDOWS
extern int g_fdMessageQueue; extern int g_fdMessageQueue;
#endif
extern Bool g_fXdmcpEnabled; extern Bool g_fXdmcpEnabled;
#ifdef XWIN_CLIPBOARD #ifdef XWIN_CLIPBOARD
extern winDispatchProcPtr winProcEstablishConnectionOrig; extern winDispatchProcPtr winProcEstablishConnectionOrig;
...@@ -150,6 +152,7 @@ InitInput (int argc, char *argv[]) ...@@ -150,6 +152,7 @@ InitInput (int argc, char *argv[])
/* Initialize the mode key states */ /* Initialize the mode key states */
winInitializeModeKeyStates (); winInitializeModeKeyStates ();
#ifdef HAS_DEVWINDOWS
/* Only open the windows message queue device once */ /* Only open the windows message queue device once */
if (g_fdMessageQueue == WIN_FD_INVALID) if (g_fdMessageQueue == WIN_FD_INVALID)
{ {
...@@ -165,6 +168,7 @@ InitInput (int argc, char *argv[]) ...@@ -165,6 +168,7 @@ InitInput (int argc, char *argv[])
/* Add the message queue as a device to wait for in WaitForSomething */ /* Add the message queue as a device to wait for in WaitForSomething */
AddEnabledDevice (g_fdMessageQueue); AddEnabledDevice (g_fdMessageQueue);
} }
#endif
#if CYGDEBUG #if CYGDEBUG
winDebug ("InitInput - returning\n"); winDebug ("InitInput - returning\n");
......
This diff is collapsed.
...@@ -139,8 +139,22 @@ ...@@ -139,8 +139,22 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <stdio.h> #include <stdio.h>
#ifndef HAS_SCPRINTF
extern int scprintf(const char *format, ...);
#else
#ifdef WIN32
#define scprintf _scprintf
#endif
#endif
#ifndef __CYGWIN__
#define sleep(x) Sleep(1000 * (x))
#endif
#include <errno.h> #include <errno.h>
#if defined(XWIN_MULTIWINDOWEXTWM) || defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
#include <pthread.h> #include <pthread.h>
#endif
#ifdef HAS_MMAP #ifdef HAS_MMAP
#include <sys/mman.h> #include <sys/mman.h>
...@@ -220,11 +234,10 @@ if (fDebugProcMsg) \ ...@@ -220,11 +234,10 @@ if (fDebugProcMsg) \
char *pszTemp; \ char *pszTemp; \
int iLength; \ int iLength; \
\ \
iLength = sprintf (NULL, str, ##__VA_ARGS__); \ iLength = scprintf (str, ##__VA_ARGS__); \
\
pszTemp = malloc (iLength + 1); \ pszTemp = malloc (iLength + 1); \
\ snprintf (pszTemp, iLength + 1, str, ##__VA_ARGS__); \
sprintf (pszTemp, str, ##__VA_ARGS__); \ pszTemp[iLength] = 0; \
\ \
MessageBox (NULL, pszTemp, szFunctionName, MB_OK); \ MessageBox (NULL, pszTemp, szFunctionName, MB_OK); \
\ \
...@@ -626,7 +639,9 @@ typedef struct { ...@@ -626,7 +639,9 @@ typedef struct {
extern winScreenInfo g_ScreenInfo[]; extern winScreenInfo g_ScreenInfo[];
extern miPointerScreenFuncRec g_winPointerCursorFuncs; extern miPointerScreenFuncRec g_winPointerCursorFuncs;
extern DWORD g_dwEvents; extern DWORD g_dwEvents;
#ifdef HAS_DEVWINDOWS
extern int g_fdMessageQueue; extern int g_fdMessageQueue;
#endif
extern int g_iScreenPrivateIndex; extern int g_iScreenPrivateIndex;
extern int g_iCmapPrivateIndex; extern int g_iCmapPrivateIndex;
extern int g_iGCPrivateIndex; extern int g_iGCPrivateIndex;
......
...@@ -48,8 +48,15 @@ winBlockHandler (int nScreen, ...@@ -48,8 +48,15 @@ winBlockHandler (int nScreen,
pointer pTimeout, pointer pTimeout,
pointer pReadMask) pointer pReadMask)
{ {
#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
winScreenPriv((ScreenPtr)pBlockData); winScreenPriv((ScreenPtr)pBlockData);
#endif
MSG msg; MSG msg;
#ifndef HAS_DEVWINDOWS
struct timeval **tvp = pTimeout;
(*tvp)->tv_sec = 0;
(*tvp)->tv_usec = 100;
#endif
#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) #if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
/* Signal threaded modules to begin */ /* Signal threaded modules to begin */
......
...@@ -35,7 +35,12 @@ ...@@ -35,7 +35,12 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#ifdef __CYGWIN__
#include <sys/select.h> #include <sys/select.h>
#else
#include "Xwinsock.h"
#define HAS_WINSOCK
#endif
#include <fcntl.h> #include <fcntl.h>
#include <setjmp.h> #include <setjmp.h>
#include <pthread.h> #include <pthread.h>
...@@ -54,6 +59,10 @@ ...@@ -54,6 +59,10 @@
/* Fixups to prevent collisions between Windows and X headers */ /* Fixups to prevent collisions between Windows and X headers */
#define ATOM DWORD #define ATOM DWORD
#ifndef __CYGWIN__
#define sleep(x) Sleep (1000 * (x))
#endif
/* Windows headers */ /* Windows headers */
#ifndef XFree86Server #ifndef XFree86Server
#define XFree86Server #define XFree86Server
...@@ -65,7 +74,9 @@ ...@@ -65,7 +74,9 @@
/* Clipboard module constants */ /* Clipboard module constants */
#define WIN_CLIPBOARD_WINDOW_CLASS "xwinclip" #define WIN_CLIPBOARD_WINDOW_CLASS "xwinclip"
#define WIN_CLIPBOARD_WINDOW_TITLE "xwinclip" #define WIN_CLIPBOARD_WINDOW_TITLE "xwinclip"
#define WIN_MSG_QUEUE_FNAME "/dev/windows" #ifdef HAS_DEVWINDOWS
# define WIN_MSG_QUEUE_FNAME "/dev/windows"
#endif
#define WIN_CONNECT_RETRIES 40 #define WIN_CONNECT_RETRIES 40
#define WIN_CONNECT_DELAY 4 #define WIN_CONNECT_DELAY 4
#define WIN_JMP_OKAY 0 #define WIN_JMP_OKAY 0
......
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
*/ */
#include "winclipboard.h" #include "winclipboard.h"
#ifdef __CYGWIN__
#include <errno.h>
#endif
#include "X11/Xauth.h" #include "X11/Xauth.h"
...@@ -86,7 +89,11 @@ winClipboardProc (void *pvNotUsed) ...@@ -86,7 +89,11 @@ winClipboardProc (void *pvNotUsed)
int iReturn; int iReturn;
HWND hwnd = NULL; HWND hwnd = NULL;
int iConnectionNumber = 0; int iConnectionNumber = 0;
#ifdef HAS_DEVWINDOWS
int fdMessageQueue = 0; int fdMessageQueue = 0;
#else
struct timeval tvTimeout;
#endif
fd_set fdsRead; fd_set fdsRead;
int iMaxDescriptor; int iMaxDescriptor;
Display *pDisplay = NULL; Display *pDisplay = NULL;
...@@ -94,6 +101,7 @@ winClipboardProc (void *pvNotUsed) ...@@ -94,6 +101,7 @@ winClipboardProc (void *pvNotUsed)
int iRetries; int iRetries;
Bool fUseUnicode; Bool fUseUnicode;
char szDisplay[512]; char szDisplay[512];
int iSelectError;
ErrorF ("winClipboardProc - Hello\n"); ErrorF ("winClipboardProc - Hello\n");
...@@ -204,6 +212,7 @@ winClipboardProc (void *pvNotUsed) ...@@ -204,6 +212,7 @@ winClipboardProc (void *pvNotUsed)
/* Get our connection number */ /* Get our connection number */
iConnectionNumber = ConnectionNumber (pDisplay); iConnectionNumber = ConnectionNumber (pDisplay);
#ifdef HAS_DEVWINDOWS
/* Open a file descriptor for the windows message queue */ /* Open a file descriptor for the windows message queue */
fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, O_RDONLY); fdMessageQueue = open (WIN_MSG_QUEUE_FNAME, O_RDONLY);
if (fdMessageQueue == -1) if (fdMessageQueue == -1)
...@@ -214,6 +223,9 @@ winClipboardProc (void *pvNotUsed) ...@@ -214,6 +223,9 @@ winClipboardProc (void *pvNotUsed)
/* Find max of our file descriptors */ /* Find max of our file descriptors */
iMaxDescriptor = max (fdMessageQueue, iConnectionNumber) + 1; iMaxDescriptor = max (fdMessageQueue, iConnectionNumber) + 1;
#else
iMaxDescriptor = iConnectionNumber + 1;
#endif
/* Select event types to watch */ /* Select event types to watch */
if (XSelectInput (pDisplay, if (XSelectInput (pDisplay,
...@@ -242,10 +254,6 @@ winClipboardProc (void *pvNotUsed) ...@@ -242,10 +254,6 @@ winClipboardProc (void *pvNotUsed)
pthread_exit (NULL); pthread_exit (NULL);
} }
#if 0
ErrorF ("winClipboardProc - iWindow: %d\n", iWindow);
#endif
/* Save the window in the screen privates */ /* Save the window in the screen privates */
g_iClipboardWindow = iWindow; g_iClipboardWindow = iWindow;
...@@ -255,17 +263,6 @@ winClipboardProc (void *pvNotUsed) ...@@ -255,17 +263,6 @@ winClipboardProc (void *pvNotUsed)
/* Save copy of HWND in screen privates */ /* Save copy of HWND in screen privates */
g_hwndClipboard = hwnd; g_hwndClipboard = hwnd;
#if 0
/* Assert ownership of CLIPBOARD_MANAGER */
iReturn = XSetSelectionOwner (pDisplay, atomClipboardManager,
iWindow, CurrentTime);
if (iReturn == BadAtom || iReturn == BadWindow)
{
ErrorF ("winClipboardProc - Could not set CLIPBOARD_MANAGER owner\n");
pthread_exit (NULL);
}
#endif
/* Assert ownership of selections if Win32 clipboard is owned */ /* Assert ownership of selections if Win32 clipboard is owned */
if (NULL != GetClipboardOwner ()) if (NULL != GetClipboardOwner ())
{ {
...@@ -316,17 +313,41 @@ winClipboardProc (void *pvNotUsed) ...@@ -316,17 +313,41 @@ winClipboardProc (void *pvNotUsed)
* which descriptors are ready. * which descriptors are ready.
*/ */
FD_ZERO (&fdsRead); FD_ZERO (&fdsRead);
FD_SET (fdMessageQueue, &fdsRead);
FD_SET (iConnectionNumber, &fdsRead); FD_SET (iConnectionNumber, &fdsRead);
#ifdef HAS_DEVWINDOWS
FD_SET (fdMessageQueue, &fdsRead);
#else
tvTimeout.tv_sec = 0;
tvTimeout.tv_usec = 100;
#endif
/* Wait for a Windows event or an X event */ /* Wait for a Windows event or an X event */
iReturn = select (iMaxDescriptor, /* Highest fds number */ iReturn = select (iMaxDescriptor, /* Highest fds number */
&fdsRead, /* Read mask */ &fdsRead, /* Read mask */
NULL, /* No write mask */ NULL, /* No write mask */
NULL, /* No exception mask */ NULL, /* No exception mask */
NULL); /* No timeout */ #ifdef HAS_DEVWINDOWS
if (iReturn <= 0) NULL /* No timeout */
#else
&tvTimeout /* Set timeout */
#endif
);
#ifndef HAS_WINSOCK
iSelectError = errno;
#else
iSelectError = WSAGetLastError();
#endif
if (iReturn < 0)
{ {
#ifndef HAS_WINSOCK
if (iSelectError == EINTR)
#else
if (iSelectError == WSAEINTR)
#endif
continue;
ErrorF ("winClipboardProc - Call to select () failed: %d. " ErrorF ("winClipboardProc - Call to select () failed: %d. "
"Bailing.\n", iReturn); "Bailing.\n", iReturn);
break; break;
...@@ -335,11 +356,6 @@ winClipboardProc (void *pvNotUsed) ...@@ -335,11 +356,6 @@ winClipboardProc (void *pvNotUsed)
/* Branch on which descriptor became active */ /* Branch on which descriptor became active */
if (FD_ISSET (iConnectionNumber, &fdsRead)) if (FD_ISSET (iConnectionNumber, &fdsRead))
{ {
/* X event ready */
#if 0
ErrorF ("winClipboardProc - X event ready\n");
#endif
/* Process X events */ /* Process X events */
/* Exit when we see that server is shutting down */ /* Exit when we see that server is shutting down */
iReturn = winClipboardFlushXEvents (hwnd, iReturn = winClipboardFlushXEvents (hwnd,
...@@ -354,14 +370,13 @@ winClipboardProc (void *pvNotUsed) ...@@ -354,14 +370,13 @@ winClipboardProc (void *pvNotUsed)
} }
} }
#ifdef HAS_DEVWINDOWS
/* Check for Windows event ready */ /* Check for Windows event ready */
if (FD_ISSET (fdMessageQueue, &fdsRead)) if (FD_ISSET (fdMessageQueue, &fdsRead))
{ #else
/* Windows event ready */ if (1)
#if 0
ErrorF ("winClipboardProc - Windows event ready\n");
#endif #endif
{
/* Process Windows messages */ /* Process Windows messages */
if (!winClipboardFlushWindowsMessageQueue (hwnd)) if (!winClipboardFlushWindowsMessageQueue (hwnd))
{ {
...@@ -383,9 +398,12 @@ winClipboardProc (void *pvNotUsed) ...@@ -383,9 +398,12 @@ winClipboardProc (void *pvNotUsed)
ErrorF ("winClipboardProc - XDestroyWindow succeeded.\n"); ErrorF ("winClipboardProc - XDestroyWindow succeeded.\n");
} }
#ifdef HAS_DEVWINDOWS
/* Close our Win32 message handle */ /* Close our Win32 message handle */
if (fdMessageQueue) if (fdMessageQueue)
close (fdMessageQueue); close (fdMessageQueue);
#endif
#if 0 #if 0
/* /*
......
...@@ -334,6 +334,8 @@ winClipboardWindowProc (HWND hwnd, UINT message, ...@@ -334,6 +334,8 @@ winClipboardWindowProc (HWND hwnd, UINT message,
* previous XSetSelectionOwner messages. * previous XSetSelectionOwner messages.
*/ */
XSync (pDisplay, FALSE); XSync (pDisplay, FALSE);
winDebug("winClipboardWindowProc - XSync done.\n");
/* Release PRIMARY selection if owned */ /* Release PRIMARY selection if owned */
iReturn = XGetSelectionOwner (pDisplay, XA_PRIMARY); iReturn = XGetSelectionOwner (pDisplay, XA_PRIMARY);
......
...@@ -374,7 +374,7 @@ winConfigKeyboard (DeviceIntPtr pDevice) ...@@ -374,7 +374,7 @@ winConfigKeyboard (DeviceIntPtr pDevice)
char lname[256]; char lname[256];
DWORD namesize = sizeof(lname); DWORD namesize = sizeof(lname);
regpath = alloca(sizeof(regtempl) + KL_NAMELENGTH + 1); regpath = malloc(sizeof(regtempl) + KL_NAMELENGTH + 1);
strcpy(regpath, regtempl); strcpy(regpath, regtempl);
strcat(regpath, layoutName); strcat(regpath, layoutName);
...@@ -388,6 +388,7 @@ winConfigKeyboard (DeviceIntPtr pDevice) ...@@ -388,6 +388,7 @@ winConfigKeyboard (DeviceIntPtr pDevice)
/* Close registry key */ /* Close registry key */
if (regkey) if (regkey)
RegCloseKey (regkey); RegCloseKey (regkey);
free(regpath);
} }
} }
...@@ -737,117 +738,19 @@ winConfigFiles () ...@@ -737,117 +738,19 @@ winConfigFiles ()
MessageType from; MessageType from;
/* Fontpath */ /* Fontpath */
from = X_DEFAULT;
if (g_cmdline.fontPath) if (g_cmdline.fontPath)
{ {
from = X_CMDLINE;
defaultFontPath = g_cmdline.fontPath; 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 */ /* RGBPath */
fclose(fontdirs); if (g_cmdline.rgbPath)
from = X_CONFIG; {
defaultFontPath = xstrdup(fontpath); from = X_CMDLINE;
free(fontpath); rgbPath = g_cmdline.rgbPath;
} winMsg (X_CMDLINE, "RgbPath set to \"%s\"\n", rgbPath);
} }
winMsg (from, "FontPath set to \"%s\"\n", defaultFontPath);
return TRUE; return TRUE;
} }
......
...@@ -419,7 +419,9 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen) ...@@ -419,7 +419,9 @@ winCreateBoundingWindowWindowed (ScreenPtr pScreen)
#endif #endif
) )
{ {
#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
pScreenPriv->fRootWindowShown = FALSE; pScreenPriv->fRootWindowShown = FALSE;
#endif
ShowWindow (*phwnd, SW_HIDE); ShowWindow (*phwnd, SW_HIDE);
} }
else else
......
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
*/ */
#include "win.h" #include "win.h"
#ifdef __CYGWIN__
#include <sys/cygwin.h> #include <sys/cygwin.h>
#endif
#include <shellapi.h> #include <shellapi.h>
#include "winprefs.h" #include "winprefs.h"
...@@ -44,7 +46,9 @@ extern HWND g_hDlgDepthChange; ...@@ -44,7 +46,9 @@ extern HWND g_hDlgDepthChange;
extern HWND g_hDlgExit; extern HWND g_hDlgExit;
extern HWND g_hDlgAbout; extern HWND g_hDlgAbout;
extern WINPREFS pref; extern WINPREFS pref;
#ifdef XWIN_CLIPBOARD
extern Bool g_fClipboardStarted; extern Bool g_fClipboardStarted;
#endif
extern Bool g_fSoftwareCursor; extern Bool g_fSoftwareCursor;
...@@ -217,11 +221,15 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv) ...@@ -217,11 +221,15 @@ winDisplayExitDialog (winPrivScreenPtr pScreenPriv)
for (i = 1; i < currentMaxClients; i++) for (i = 1; i < currentMaxClients; i++)
if (clients[i] != NullClient) if (clients[i] != NullClient)
liveClients++; liveClients++;
#if defined(XWIN_MULTIWINDOW)
/* Count down server internal clients */ /* Count down server internal clients */
if (pScreenPriv->pScreenInfo->fMultiWindow) if (pScreenPriv->pScreenInfo->fMultiWindow)
liveClients -= 2; /* multiwindow window manager & XMsgProc */ liveClients -= 2; /* multiwindow window manager & XMsgProc */
#endif
#if defined(XWIN_CLIPBOARD)
if (g_fClipboardStarted) if (g_fClipboardStarted)
liveClients--; /* clipboard manager */ liveClients--; /* clipboard manager */
#endif
/* A user reported that this sometimes drops below zero. just eye-candy. */ /* A user reported that this sometimes drops below zero. just eye-candy. */
if (liveClients < 0) if (liveClients < 0)
...@@ -314,7 +322,7 @@ winExitDlgProc (HWND hDialog, UINT message, ...@@ -314,7 +322,7 @@ winExitDlgProc (HWND hDialog, UINT message,
MAKEINTRESOURCE(IDI_XWIN))); MAKEINTRESOURCE(IDI_XWIN)));
/* Format the connected clients string */ /* Format the connected clients string */
iReturn = sprintf (NULL, CONNECTED_CLIENTS_FORMAT, iReturn = scprintf (CONNECTED_CLIENTS_FORMAT,
s_pScreenPriv->iConnectedClients); s_pScreenPriv->iConnectedClients);
if (iReturn <= 0) if (iReturn <= 0)
return TRUE; return TRUE;
...@@ -323,6 +331,7 @@ winExitDlgProc (HWND hDialog, UINT message, ...@@ -323,6 +331,7 @@ winExitDlgProc (HWND hDialog, UINT message,
return TRUE; return TRUE;
snprintf (pszConnectedClients, iReturn + 1, CONNECTED_CLIENTS_FORMAT, snprintf (pszConnectedClients, iReturn + 1, CONNECTED_CLIENTS_FORMAT,
s_pScreenPriv->iConnectedClients); s_pScreenPriv->iConnectedClients);
pszConnectedClients[iReturn] = 0;
/* Set the number of connected clients */ /* Set the number of connected clients */
SetWindowText (GetDlgItem (hDialog, IDC_CLIENTS_CONNECTED), SetWindowText (GetDlgItem (hDialog, IDC_CLIENTS_CONNECTED),
...@@ -669,13 +678,18 @@ winAboutDlgProc (HWND hwndDialog, UINT message, ...@@ -669,13 +678,18 @@ winAboutDlgProc (HWND hwndDialog, UINT message,
case ID_ABOUT_CHANGELOG: case ID_ABOUT_CHANGELOG:
{ {
int iReturn;
#ifdef __CYGWIN__
const char * pszCygPath = "/usr/X11R6/share/doc/" const char * pszCygPath <