xserver: Branch 'master' - 3 commits

Jon TURNEY jturney at kemper.freedesktop.org
Thu Dec 18 04:40:07 PST 2008


 hw/xwin/winclipboard.h            |    6 +++---
 hw/xwin/winmultiwindowclass.c     |    2 +-
 hw/xwin/winmultiwindowshape.c     |    1 -
 hw/xwin/winmultiwindowwindow.c    |   10 +++-------
 hw/xwin/winshaddd.c               |   28 +++++++++++++++++++++-------
 hw/xwin/winshadddnl.c             |   19 ++++++++++++++++---
 hw/xwin/winwin32rootless.c        |    8 +++++++-
 hw/xwin/winwin32rootlesswndproc.c |    2 +-
 hw/xwin/winwindow.c               |    4 ----
 hw/xwin/winwindowswm.c            |    2 +-
 10 files changed, 53 insertions(+), 29 deletions(-)

New commits:
commit 21a2df9f359584e634dc12d8602401d54defd7db
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Sun Nov 2 20:46:44 2008 +0000

    Xming,Cygwin/X: Fix crashes when using the DirectDraw '-refresh rate-in-Hz' option in -fullscreen (#11128)
    
    fd.o bugzilla #11128
    
    Fix crashes when using the '-refresh rate-in-Hz' option in -fullscreen mode and using a DirectDraw engine.
    On failure (typically 0x80004001 DDERR_UNSUPPORTED), use the default refresh rate for the driver, instead of the
    entered value.
    
    Also fix some nearby error reporting
    
    Copyright (C) Colin Harrison 2005-2008
    http://www.straightrunning.com/XmingNotes/
    http://sourceforge.net/projects/xming/
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
index 5f5daeb..6e1f973 100644
--- a/hw/xwin/winshaddd.c
+++ b/hw/xwin/winshaddd.c
@@ -361,7 +361,7 @@ winAllocateFBShadowDD (ScreenPtr pScreen)
 	{
 	  ErrorF ("winAllocateFBShadowDD - Changing video mode\n");
 
-	  /* Change the video mode to the mode requested */
+	  /* Change the video mode to the mode requested, and use the driver default refresh rate on failure */
 	  ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2,
 						pScreenInfo->dwWidth,
 						pScreenInfo->dwHeight,
@@ -373,7 +373,20 @@ winAllocateFBShadowDD (ScreenPtr pScreen)
 	      ErrorF ("winAllocateFBShadowDD - Could not set "\
 		      "full screen display mode: %08x\n",
 		      (unsigned int) ddrval);
-	      return FALSE;
+	      ErrorF ("winAllocateFBShadowDD - Using default driver refresh rate\n");
+	      ddrval = IDirectDraw2_SetDisplayMode (pScreenPriv->pdd2,
+						    pScreenInfo->dwWidth,
+						    pScreenInfo->dwHeight,
+						    pScreenInfo->dwBPP,
+						    0,
+						    0);
+	      if (FAILED(ddrval))
+		{
+			ErrorF ("winAllocateFBShadowDD - Could not set default refresh rate "
+				"full screen display mode: %08x\n",
+				(unsigned int) ddrval);
+			return FALSE;
+		}
 	    }
 	}
       else
@@ -534,7 +547,7 @@ winShadowUpdateDD (ScreenPtr pScreen,
   ddrval = IDirectDrawSurface2_Unlock (pScreenPriv->pddsShadow, NULL);
   if (FAILED (ddrval))
     {
-      ErrorF ("winShadowUpdateProcDD - Unlock failed\n");
+      ErrorF ("winShadowUpdateDD - Unlock failed\n");
       return;
     }
 
@@ -626,19 +639,20 @@ winShadowUpdateDD (ScreenPtr pScreen,
 				     NULL);
   if (FAILED (ddrval))
     {
-      ErrorF ("winShadowUpdateProcDD - Lock failed\n");
+      ErrorF ("winShadowUpdateDD - Lock failed\n");
       return;
     }
 
   /* Has our memory pointer changed? */
   if (pScreenInfo->pfb != pScreenPriv->pddsdShadow->lpSurface)
     {
-      ErrorF ("winShadowUpdateProcDD - Memory location of the shadow "
+      extern 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 "
 	      "this message and "PROJECT_NAME" freezes or crashes "
 	      "after this message then send a problem report and your "
-	      "/tmp/XWin.log file to cygwin-xfree at cygwin.com\n");
+	      "%s file to " BUILDERADDR, g_pszLogFile);
 
       /* Location of shadow framebuffer has changed */
       pScreenInfo->pfb = pScreenPriv->pddsdShadow->lpSurface;
@@ -653,7 +667,7 @@ winShadowUpdateDD (ScreenPtr pScreen,
 							 pScreenInfo->dwBPP),
 					  pScreenInfo->pfb))
 	{
-	  ErrorF ("winShadowUpdateProcDD - Bits changed, could not "
+	  ErrorF ("winShadowUpdateDD - Bits changed, could not "
 		  "notify fb.\n");
 	  return;
 	}
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index 630c720..ef5c214 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -391,7 +391,7 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen)
 	{
 	  winDebug ("winAllocateFBShadowDDNL - Changing video mode\n");
 
-	  /* Change the video mode to the mode requested */
+	  /* Change the video mode to the mode requested, and use the driver default refresh rate on failure */
 	  ddrval = IDirectDraw4_SetDisplayMode (pScreenPriv->pdd4,
 						pScreenInfo->dwWidth,
 						pScreenInfo->dwHeight,
@@ -403,7 +403,20 @@ winAllocateFBShadowDDNL (ScreenPtr pScreen)
 	      ErrorF ("winAllocateFBShadowDDNL - Could not set "
 		      "full screen display mode: %08x\n",
 		      (unsigned int) ddrval);
-	      return FALSE;
+	      ErrorF ("winAllocateFBShadowDDNL - Using default driver refresh rate\n");
+	      ddrval = IDirectDraw4_SetDisplayMode (pScreenPriv->pdd4,
+						    pScreenInfo->dwWidth,
+						    pScreenInfo->dwHeight,
+						    pScreenInfo->dwBPP,
+						    0,
+						    0);
+	      if (FAILED(ddrval))
+		{
+			ErrorF ("winAllocateFBShadowDDNL - Could not set default refresh rate "
+				"full screen display mode: %08x\n",
+				(unsigned int) ddrval);
+			return FALSE;
+		}
 	    }
 	}
       else
@@ -1310,7 +1323,7 @@ winStoreColorsShadowDDNL (ColormapPtr pColormap,
 					  + pdefs[0].pixel);
   if (FAILED (ddrval))
     {
-      ErrorF ("winStoreColorsShadowDDNL - SetEntries () failed: %08x\n", ddrval);
+      ErrorF ("winStoreColorsShadowDDNL - SetEntries () failed: %08x\n", (unsigned int) ddrval);
       return FALSE;
     }
 
commit b0ed1567c1782041cf3d14ec6dd4d622915c7d0c
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Wed Dec 17 17:16:02 2008 +0000

    Xming, Cygwin/X: Tidy up warnings, headers and unused variables (#11132)
    
    Tidy up various warnings, include headers and unused variables, etc.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winclipboard.h b/hw/xwin/winclipboard.h
index 445c01b..0602229 100644
--- a/hw/xwin/winclipboard.h
+++ b/hw/xwin/winclipboard.h
@@ -38,7 +38,7 @@
 #ifdef __CYGWIN__
 #include <sys/select.h>
 #else
-#include "Xwinsock.h"
+#include <X11/Xwinsock.h>
 #define HAS_WINSOCK
 #endif
 #include <fcntl.h>
@@ -53,8 +53,8 @@
  * are usually bad, so someone should investigate this.
  */
 #include <X11/Xproto.h>
-#include "X11/Xutil.h"
-#include "X11/Xlocale.h"
+#include <X11/Xutil.h>
+#include <X11/Xlocale.h>
 
 /* Fixups to prevent collisions between Windows and X headers */
 #define ATOM			DWORD
diff --git a/hw/xwin/winmultiwindowshape.c b/hw/xwin/winmultiwindowshape.c
index 62cddd0..4400702 100644
--- a/hw/xwin/winmultiwindowshape.c
+++ b/hw/xwin/winmultiwindowshape.c
@@ -44,7 +44,6 @@ void
 winSetShapeMultiWindow (WindowPtr pWin)
 {
   ScreenPtr		pScreen = pWin->drawable.pScreen;
-  winWindowPriv(pWin);
   winScreenPriv(pScreen);
 
 #if CYGMULTIWINDOW_DEBUG
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 75bef97..6cad631 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -275,7 +275,6 @@ winChangeWindowAttributesMultiWindow (WindowPtr pWin, unsigned long mask)
 {
   Bool			fResult = TRUE;
   ScreenPtr		pScreen = pWin->drawable.pScreen;
-  winWindowPriv(pWin);
   winScreenPriv(pScreen);
 
 #if CYGMULTIWINDOW_DEBUG
@@ -368,7 +367,6 @@ void
 winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent)
 {
   ScreenPtr		pScreen = pWin->drawable.pScreen;
-  winWindowPriv(pWin);
   winScreenPriv(pScreen);
 
 #if CYGMULTIWINDOW_DEBUG
@@ -392,12 +390,13 @@ winReparentWindowMultiWindow (WindowPtr pWin, WindowPtr pPriorParent)
 void
 winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib)
 {
+#if 0
   WindowPtr		pPrevWin;
   UINT			uFlags;
   HWND			hInsertAfter;
   HWND                  hWnd = NULL;
+#endif
   ScreenPtr		pScreen = pWin->drawable.pScreen;
-  winWindowPriv(pWin);
   winScreenPriv(pScreen);
 
 #if CYGMULTIWINDOW_DEBUG || CYGWINDOWING_DEBUG
@@ -854,7 +853,7 @@ winMinimizeWindow (Window id)
   ErrorF ("winMinimizeWindow\n");
 #endif
 
-  pWin = LookupIDByType (id, RT_WINDOW);
+  pWin = (WindowPtr) LookupIDByType (id, RT_WINDOW);
   if (!pWin) 
   { 
       ErrorF("%s: NULL pWin. Leaving\n", __FUNCTION__); 
@@ -892,7 +891,6 @@ winCopyWindowMultiWindow (WindowPtr pWin, DDXPointRec oldpt,
 			  RegionPtr oldRegion)
 {
   ScreenPtr		pScreen = pWin->drawable.pScreen;
-  winWindowPriv(pWin);
   winScreenPriv(pScreen);
 
 #if CYGWINDOWING_DEBUG
@@ -912,7 +910,6 @@ winMoveWindowMultiWindow (WindowPtr pWin, int x, int y,
 			  WindowPtr pSib, VTKind kind)
 {
   ScreenPtr		pScreen = pWin->drawable.pScreen;
-  winWindowPriv(pWin);
   winScreenPriv(pScreen);
 
 #if CYGWINDOWING_DEBUG
@@ -933,7 +930,6 @@ winResizeWindowMultiWindow (WindowPtr pWin, int x, int y, unsigned int w,
 			    unsigned int h, WindowPtr pSib)
 {
   ScreenPtr		pScreen = pWin->drawable.pScreen;
-  winWindowPriv(pWin);
   winScreenPriv(pScreen);
 
 #if CYGWINDOWING_DEBUG
diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c
index 6f4e2c9..406d1e0 100755
--- a/hw/xwin/winwin32rootless.c
+++ b/hw/xwin/winwin32rootless.c
@@ -38,7 +38,7 @@
 #include "win.h"
 #include <winuser.h>
 #define _WINDOWSWM_SERVER_
-#include "windowswmstr.h"
+#include <X11/extensions/windowswmstr.h>
 #include "dixevents.h"
 #include "winmultiwindowclass.h"
 #include "winprefs.h"
@@ -51,9 +51,15 @@
 
 #define MOUSE_POLLING_INTERVAL		500
 
+#ifndef ULW_COLORKEY
 #define ULW_COLORKEY	0x00000001
+#endif
+#ifndef ULW_ALPHA
 #define ULW_ALPHA	0x00000002
+#endif
+#ifndef ULW_OPAQUE
 #define ULW_OPAQUE	0x00000004
+#endif
 #define AC_SRC_ALPHA	0x01
 
 /*
diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c
index 6518469..32a6b69 100755
--- a/hw/xwin/winwin32rootlesswndproc.c
+++ b/hw/xwin/winwin32rootlesswndproc.c
@@ -35,7 +35,7 @@
 #include "win.h"
 #include <winuser.h>
 #define _WINDOWSWM_SERVER_
-#include "windowswmstr.h"
+#include <X11/extensions/windowswmstr.h>
 #include "dixevents.h"
 #include "propertyst.h"
 #include <X11/Xatom.h>
diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c
index 285a344..0e75a2c 100644
--- a/hw/xwin/winwindow.c
+++ b/hw/xwin/winwindow.c
@@ -350,7 +350,6 @@ winPositionWindowRootless (WindowPtr pWin, int x, int y)
 {
   Bool			fResult = FALSE;
   ScreenPtr		pScreen = pWin->drawable.pScreen;
-  winWindowPriv(pWin);
   winScreenPriv(pScreen);
 
 
@@ -376,7 +375,6 @@ winChangeWindowAttributesRootless (WindowPtr pWin, unsigned long mask)
 {
   Bool			fResult = FALSE;
   ScreenPtr		pScreen = pWin->drawable.pScreen;
-  winWindowPriv(pWin);
   winScreenPriv(pScreen);
 
 #if CYGDEBUG
@@ -434,7 +432,6 @@ winMapWindowRootless (WindowPtr pWin)
 {
   Bool			fResult = FALSE;
   ScreenPtr		pScreen = pWin->drawable.pScreen;
-  winWindowPriv(pWin);
   winScreenPriv(pScreen);
 
 #if CYGDEBUG
@@ -457,7 +454,6 @@ void
 winSetShapeRootless (WindowPtr pWin)
 {
   ScreenPtr		pScreen = pWin->drawable.pScreen;
-  winWindowPriv(pWin);
   winScreenPriv(pScreen);
 
 #if CYGDEBUG
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index ed9642a..2eecd6b 100755
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -40,7 +40,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "servermd.h"
 #include "swaprep.h"
 #define _WINDOWSWM_SERVER_
-#include "windowswmstr.h"
+#include <X11/extensions/windowswmstr.h>
 
 static int WMErrorBase;
 
commit 15c4a6e088039e14b4f2387ff204cb5448916b39
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Wed Dec 17 16:44:07 2008 +0000

    Xming, Cygwin/X: Fix crash in function winMultiWindowGetTransientFor() (#11147)
    
    The function winMultiWindowGetTransientFor() crashes, due to a bogus pointer
    dereference, but this fact was previously hidden by the function not being called!
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winmultiwindowclass.c b/hw/xwin/winmultiwindowclass.c
index 5b47c39..a5cf212 100755
--- a/hw/xwin/winmultiwindowclass.c
+++ b/hw/xwin/winmultiwindowclass.c
@@ -263,7 +263,7 @@ winMultiWindowGetTransientFor (WindowPtr pWin, WindowPtr *ppDaddy)
       if (prop->propertyName == XA_WM_TRANSIENT_FOR)
         {
           if (ppDaddy)
-            memcpy (*ppDaddy, prop->data, sizeof (WindowPtr));
+            memcpy (ppDaddy, prop->data, sizeof (WindowPtr));
           return 1;
         }
       else


More information about the xorg-commit mailing list