diff options
Diffstat (limited to 'xorg-server/hw/xwin/winshaddd.c')
-rw-r--r-- | xorg-server/hw/xwin/winshaddd.c | 57 |
1 files changed, 17 insertions, 40 deletions
diff --git a/xorg-server/hw/xwin/winshaddd.c b/xorg-server/hw/xwin/winshaddd.c index 4904eb440..688cc58d2 100644 --- a/xorg-server/hw/xwin/winshaddd.c +++ b/xorg-server/hw/xwin/winshaddd.c @@ -35,6 +35,7 @@ #include <xwin-config.h> #endif #include "win.h" +#include "winprefs.h" /* * Local prototypes @@ -113,9 +114,7 @@ winCreatePrimarySurfaceShadowDD(ScreenPtr pScreen) return FALSE; } -#if CYGDEBUG winDebug("winCreatePrimarySurfaceShadowDD - Created primary surface\n"); -#endif /* * Attach a clipper to the primary surface that will clip our blits to our @@ -129,10 +128,8 @@ winCreatePrimarySurfaceShadowDD(ScreenPtr pScreen) return FALSE; } -#if CYGDEBUG winDebug("winCreatePrimarySurfaceShadowDD - Attached clipper to " "primary surface\n"); -#endif /* Everything was correct */ return TRUE; @@ -148,7 +145,7 @@ winReleasePrimarySurfaceShadowDD(ScreenPtr pScreen) { winScreenPriv(pScreen); - ErrorF("winReleasePrimarySurfaceShadowDD - Hello\n"); + winDebug ("winReleasePrimarySurfaceShadowDD - Hello\n"); /* Release the primary surface and clipper, if they exist */ if (pScreenPriv->pddsPrimary) { @@ -158,14 +155,14 @@ winReleasePrimarySurfaceShadowDD(ScreenPtr pScreen) */ IDirectDrawSurface2_SetClipper(pScreenPriv->pddsPrimary, NULL); - ErrorF("winReleasePrimarySurfaceShadowDD - Detached clipper\n"); + winDebug ("winReleasePrimarySurfaceShadowDD - Detached clipper\n"); /* Release the primary surface */ IDirectDrawSurface2_Release(pScreenPriv->pddsPrimary); pScreenPriv->pddsPrimary = NULL; } - ErrorF("winReleasePrimarySurfaceShadowDD - Released primary surface\n"); + winDebug ("winReleasePrimarySurfaceShadowDD - Released primary surface\n"); return TRUE; } @@ -187,9 +184,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen) DDSURFACEDESC ddsd; DDSURFACEDESC *pddsdShadow = NULL; -#if CYGDEBUG winDebug("winAllocateFBShadowDD\n"); -#endif /* Create a clipper */ ddrval = (*g_fpDirectDrawCreateClipper) (0, @@ -200,9 +195,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen) return FALSE; } -#if CYGDEBUG winDebug("winAllocateFBShadowDD - Created a clipper\n"); -#endif /* Attach the clipper to our display window */ ddrval = IDirectDrawClipper_SetHWnd(pScreenPriv->pddcPrimary, @@ -213,9 +206,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen) return FALSE; } -#if CYGDEBUG winDebug("winAllocateFBShadowDD - Attached clipper to window\n"); -#endif /* Create a DirectDraw object, store the address at lpdd */ ddrval = (*g_fpDirectDrawCreate) (NULL, &pScreenPriv->pdd, NULL); @@ -225,9 +216,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen) return FALSE; } -#if CYGDEBUG winDebug("winAllocateFBShadowDD () - Created and initialized DD\n"); -#endif /* Get a DirectDraw2 interface pointer */ ddrval = IDirectDraw_QueryInterface(pScreenPriv->pdd, @@ -300,7 +289,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen) || pScreenInfo->dwHeight != GetSystemMetrics(SM_CYSCREEN) || pScreenInfo->dwBPP != GetDeviceCaps(hdc, BITSPIXEL) || pScreenInfo->dwRefreshRate != 0)) { - ErrorF("winAllocateFBShadowDD - Changing video mode\n"); + winDebug ("winAllocateFBShadowDD - Changing video mode\n"); /* Change the video mode to the mode requested, and use the driver default refresh rate on failure */ ddrval = IDirectDraw2_SetDisplayMode(pScreenPriv->pdd2, @@ -329,7 +318,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen) } } else { - ErrorF("winAllocateFBShadowDD - Not changing video mode\n"); + winDebug ("winAllocateFBShadowDD - Not changing video mode\n"); } /* Release our DC */ @@ -379,9 +368,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen) return FALSE; } -#if CYGDEBUG winDebug("winAllocateFBShadowDD - Created shadow\n"); -#endif /* Allocate a DD surface description for our screen privates */ pddsdShadow = pScreenPriv->pddsdShadow = malloc(sizeof(DDSURFACEDESC)); @@ -393,9 +380,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen) ZeroMemory(pddsdShadow, sizeof(*pddsdShadow)); pddsdShadow->dwSize = sizeof(*pddsdShadow); -#if CYGDEBUG winDebug("winAllocateFBShadowDD - Locking shadow\n"); -#endif /* Lock the shadow surface */ ddrval = IDirectDrawSurface2_Lock(pScreenPriv->pddsShadow, @@ -406,9 +391,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen) return FALSE; } -#if CYGDEBUG winDebug("winAllocateFBShadowDD - Locked shadow\n"); -#endif /* We don't know how to deal with anything other than RGB */ if (!(pddsdShadow->ddpfPixelFormat.dwFlags & DDPF_RGB)) { @@ -428,9 +411,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen) pScreenPriv->dwGreenMask = pddsdShadow->ddpfPixelFormat.u3.dwGBitMask; pScreenPriv->dwBlueMask = pddsdShadow->ddpfPixelFormat.u4.dwBBitMask; -#if CYGDEBUG winDebug("winAllocateFBShadowDD - Returning\n"); -#endif return TRUE; } @@ -594,6 +575,7 @@ winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf) /* Has our memory pointer changed? */ if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface) { + extern const char *g_pszLogFile; ErrorF("winShadowUpdateDD - Memory location of the shadow " "surface has changed, trying to update the root window " "pixmap header to point to the new address. If you get " @@ -630,9 +612,7 @@ winCloseScreenShadowDD(ScreenPtr pScreen) winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; Bool fReturn; -#if CYGDEBUG winDebug("winCloseScreenShadowDD - Freeing screen resources\n"); -#endif /* Flag that the screen is closed */ pScreenPriv->fClosed = TRUE; @@ -652,7 +632,7 @@ winCloseScreenShadowDD(ScreenPtr pScreen) RemoveProp(pScreenPriv->hwndScreen, WIN_SCR_PROP); /* Delete tray icon, if we have one */ - if (!pScreenInfo->fNoTrayIcon) + if (!pScreenInfo->fNoTrayIcon && !pref.fNoTrayIcon) winDeleteNotifyIcon(pScreenPriv); /* Free the exit confirmation dialog box, if it exists */ @@ -669,7 +649,7 @@ winCloseScreenShadowDD(ScreenPtr pScreen) #if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) /* Destroy the thread startup mutex */ - pthread_mutex_destroy(&pScreenPriv->pmServerStarted); + if (pScreenPriv->pmServerStarted) pthread_mutex_destroy (&pScreenPriv->pmServerStarted); #endif /* Kill our screeninfo's pointer to the screen */ @@ -711,13 +691,13 @@ winInitVisualsShadowDD(ScreenPtr pScreen) else pScreenPriv->dwBitsPerRGB = dwBlueBits; - ErrorF("winInitVisualsShadowDD - Masks %08x %08x %08x BPRGB %d d %d " - "bpp %d\n", - (unsigned int) pScreenPriv->dwRedMask, - (unsigned int) pScreenPriv->dwGreenMask, - (unsigned int) pScreenPriv->dwBlueMask, - (int) pScreenPriv->dwBitsPerRGB, - (int) pScreenInfo->dwDepth, (int) pScreenInfo->dwBPP); + winDebug ("winInitVisualsShadowDD - Masks %08x %08x %08x BPRGB %d d %d " + "bpp %d\n", + (unsigned int) pScreenPriv->dwRedMask, + (unsigned int) pScreenPriv->dwGreenMask, + (unsigned int) pScreenPriv->dwBlueMask, + (int) pScreenPriv->dwBitsPerRGB, + (int) pScreenInfo->dwDepth, (int) pScreenInfo->dwBPP); /* Create a single visual according to the Windows screen depth */ switch (pScreenInfo->dwDepth) { @@ -771,9 +751,7 @@ winInitVisualsShadowDD(ScreenPtr pScreen) return FALSE; } -#if CYGDEBUG winDebug("winInitVisualsShadowDD - Returning\n"); -#endif return TRUE; } @@ -1016,6 +994,7 @@ winRedrawScreenShadowDD(ScreenPtr pScreen) if (FAILED(ddrval)) { ErrorF("winRedrawScreenShadowDD - IDirectDrawSurface_Blt () " "failed: %08x\n", (unsigned int) ddrval); + return FALSE; } return TRUE; @@ -1144,10 +1123,8 @@ winDestroyColormapShadowDD(ColormapPtr pColormap) * we need to handle the default colormap in a special way. */ if (pColormap->flags & IsDefault) { -#if CYGDEBUG winDebug("winDestroyColormapShadowDD - Destroying default " "colormap\n"); -#endif /* * FIXME: Walk the list of all screens, popping the default |