diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 256af0bb1..c49016398 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -175,7 +175,8 @@ install-exec-hook: EXTRA_DIST = \ $(xwinconfig_DATA) \ X.ico \ - XWin.rc + XWin.rc \ + XWin.exe.manifest relink: $(AM_V_at)rm -f XWin$(EXEEXT) && $(MAKE) XWin$(EXEEXT) diff --git a/hw/xwin/winclipboard.h b/hw/xwin/winclipboard.h index 089c2913b..6b5249fd1 100644 --- a/hw/xwin/winclipboard.h +++ b/hw/xwin/winclipboard.h @@ -39,7 +39,6 @@ #include #else #include -#define HAS_WINSOCK #endif #include #include diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c index e7df4527e..908dfcea2 100644 --- a/hw/xwin/winclipboardthread.c +++ b/hw/xwin/winclipboardthread.c @@ -32,6 +32,8 @@ #ifdef HAVE_XWIN_CONFIG_H #include +#else +#define HAS_WINSOCK 1 #endif #include #include "winclipboard.h" diff --git a/hw/xwin/winengine.c b/hw/xwin/winengine.c index e866e1ea1..752c4fe68 100644 --- a/hw/xwin/winengine.c +++ b/hw/xwin/winengine.c @@ -192,15 +192,12 @@ winSetEngine (ScreenPtr pScreen) /* ShadowGDI is the only engine that supports Multi Window Mode */ if ( -#ifdef XWIN_MULTIWINDOWEXTWM - pScreenInfo->fMWExtWM -#else FALSE +#ifdef XWIN_MULTIWINDOWEXTWM + || pScreenInfo->fMWExtWM #endif #ifdef XWIN_MULTIWINDOW || pScreenInfo->fMultiWindow -#else - || FALSE #endif ) { diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 67a58a076..7c4056388 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -1201,11 +1201,13 @@ winInitWM (void **ppWMInfo, XMsgProcArgPtr pXMsgArg = (XMsgProcArgPtr) malloc (sizeof(XMsgProcArgRec)); /* Bail if the input parameters are bad */ - if (pArg == NULL || pWMInfo == NULL) - { - ErrorF ("winInitWM - malloc failed.\n"); - return FALSE; - } + if (pArg == NULL || pWMInfo == NULL || pXMsgArg == NULL) { + ErrorF ("winInitWM - malloc failed.\n"); + free(pArg); + free(pWMInfo); + free(pXMsgArg); + return FALSE; + } /* Zero the allocated memory */ ZeroMemory (pArg, sizeof (WMProcArgRec)); diff --git a/hw/xwin/winnativegdi.c b/hw/xwin/winnativegdi.c index 4d7afe898..68f802005 100644 --- a/hw/xwin/winnativegdi.c +++ b/hw/xwin/winnativegdi.c @@ -315,7 +315,6 @@ static Bool winActivateAppNativeGDI (ScreenPtr pScreen) { winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; /* * Are we active? @@ -323,7 +322,8 @@ winActivateAppNativeGDI (ScreenPtr pScreen) */ if (pScreenPriv != NULL && pScreenPriv->fActive - && pScreenInfo->fFullScreen) + && pScreenPriv->pScreenInfo + && pScreenPriv->pScreenInfo->fFullScreen) { /* * Activating, attempt to bring our window @@ -338,7 +338,8 @@ winActivateAppNativeGDI (ScreenPtr pScreen) */ if (pScreenPriv != NULL && !pScreenPriv->fActive - && pScreenInfo->fFullScreen) + && pScreenPriv->pScreenInfo + && pScreenPriv->pScreenInfo->fFullScreen) { /* * Deactivating, stuff our window onto the diff --git a/hw/xwin/winpfbdd.c b/hw/xwin/winpfbdd.c index a3990208d..1a5a0e7aa 100644 --- a/hw/xwin/winpfbdd.c +++ b/hw/xwin/winpfbdd.c @@ -461,12 +461,12 @@ static Bool winActivateAppPrimaryDD (ScreenPtr pScreen) { winScreenPriv(pScreen); - winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; RECT rcSrc, rcClient; HRESULT ddrval = DD_OK; /* Check for errors */ if (pScreenPriv == NULL + || pScreenPriv->pScreenInfo == NULL || pScreenPriv->pddsPrimary == NULL || pScreenPriv->pddsOffscreen == NULL) return FALSE; @@ -500,8 +500,8 @@ winActivateAppPrimaryDD (ScreenPtr pScreen) /* Setup a source rectangle */ rcSrc.left = 0; rcSrc.top = 0; - rcSrc.right = pScreenInfo->dwWidth; - rcSrc.bottom = pScreenInfo->dwHeight; + rcSrc.right = pScreenPriv->pScreenInfo->dwWidth; + rcSrc.bottom = pScreenPriv->pScreenInfo->dwHeight; ddrval = IDirectDrawSurface2_Blt (pScreenPriv->pddsPrimary, &rcClient, diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c index c58119360..596c1ab9d 100644 --- a/hw/xwin/winrandr.c +++ b/hw/xwin/winrandr.c @@ -122,8 +122,6 @@ Bool winRandRScreenSetSize (ScreenPtr pScreen, CARD16 width, CARD16 height, - CARD16 pixWidth, - CARD16 pixHeight, CARD32 mmWidth, CARD32 mmHeight) { diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c index 1e7cb006c..6339010b6 100644 --- a/hw/xwin/winshadgdi.c +++ b/hw/xwin/winshadgdi.c @@ -270,7 +270,6 @@ winQueryRGBBitsAndMasks (ScreenPtr pScreen) else { ErrorF ("winQueryRGBBitsAndMasks - winQueryScreenDIBFormat failed\n"); - free (pbmih); fReturn = FALSE; } diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c index 8f9917a7b..91399c248 100644 --- a/hw/xwin/winwin32rootless.c +++ b/hw/xwin/winwin32rootless.c @@ -551,7 +551,7 @@ winMWExtWMRestackFrame (RootlessFrameID wid, RootlessFrameID nextWid) winDebug ("winMWExtWMRestackFrame (%08x)\n", (int) pRLWinPriv); #endif - if (pScreenPriv->fRestacking) return; + if (pScreenPriv && pScreenPriv->fRestacking) return; if (pScreenPriv) pScreenInfo = pScreenPriv->pScreenInfo; @@ -640,8 +640,6 @@ winMWExtWMRestackFrame (RootlessFrameID wid, RootlessFrameID nextWid) SetWindowPos (pRLWinPriv->hWnd, pRLNextWinPriv->hWnd, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE); -#if 0 -#endif } #if CYGMULTIWINDOW_DEBUG winDebug ("winMWExtWMRestackFrame - done (%08x)\n", (int) pRLWinPriv); diff --git a/hw/xwin/winwin32rootlesswindow.c b/hw/xwin/winwin32rootlesswindow.c index 214e8954b..fbff83888 100644 --- a/hw/xwin/winwin32rootlesswindow.c +++ b/hw/xwin/winwin32rootlesswindow.c @@ -202,7 +202,8 @@ winMWExtWMDecorateWindow (HWND hwnd, LPARAM lParam) /* Check if the Windows window property for our X window pointer is valid */ if ((pRLWinPriv = (win32RootlessWindowPtr)GetProp (hwnd, WIN_WINDOW_PROP)) != NULL) { - pScreen = pRLWinPriv->pFrame->win->drawable.pScreen; + if (pRLWinPriv != NULL && pRLWinPriv->pFrame != NULL && pRLWinPriv->pFrame->win != NULL) + pScreen = pRLWinPriv->pFrame->win->drawable.pScreen; if (pScreen) pScreenPriv = winGetScreenPriv(pScreen); if (pScreenPriv) pScreenInfo = pScreenPriv->pScreenInfo; if (pRLWinPriv && pScreenInfo) winMWExtWMUpdateWindowDecoration (pRLWinPriv, pScreenInfo);