xserver: Branch 'randr-1.2-for-server-1.2'

Keith Packard keithp at kemper.freedesktop.org
Sun Dec 31 07:52:50 EET 2006


 randr/rrinfo.c   |   23 +++++++++--------------
 randr/rrscreen.c |    9 ++++++---
 2 files changed, 15 insertions(+), 17 deletions(-)

New commits:
diff-tree f05dd384d38c76dd9662933a03625dfef5b1c81f (from 06a4be5e7a5371881106b6f51368330a33b26401)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Sat Dec 30 21:52:22 2006 -0800

    Use RRScreenSetSizeRange in 1.0 compat. Check RRGetInfo for error.
    
    The RRScreenSizeSetRange function is used externally for 1.2 API drivers,
    but can also be used in the 1.0 compatibility code. This also ensures that
    the right changed bits are set so that clients are correctly notified when
    the range changes.
    
    RRGetInfo can return an error, use that to return BadAlloc to clients
    instead of blindly going on with various requests.

diff --git a/randr/rrinfo.c b/randr/rrinfo.c
index 85426f6..797cdb1 100644
--- a/randr/rrinfo.c
+++ b/randr/rrinfo.c
@@ -169,18 +169,7 @@ RRScanOldConfig (ScreenPtr pScreen, Rota
 	if (height > maxHeight) maxHeight = height;
     }
 
-    if (minWidth != pScrPriv->minWidth) {
-	pScrPriv->minWidth = minWidth; pScrPriv->changed = TRUE;
-    }
-    if (maxWidth != pScrPriv->maxWidth) {
-	pScrPriv->maxWidth = maxWidth; pScrPriv->changed = TRUE;
-    }
-    if (minHeight != pScrPriv->minHeight) {
-	pScrPriv->minHeight = minHeight; pScrPriv->changed = TRUE;
-    }
-    if (maxHeight != pScrPriv->maxHeight) {
-	pScrPriv->maxHeight = maxHeight; pScrPriv->changed = TRUE;
-    }
+    RRScreenSetSizeRange (pScreen, minWidth, minHeight, maxWidth, maxHeight);
 
     /* notice current mode */
     if (newMode)
@@ -219,7 +208,6 @@ RRGetInfo (ScreenPtr pScreen)
     return TRUE;
 }
 
-#if RANDR_12_INTERFACE
 /*
  * Register the range of sizes for the screen
  */
@@ -234,12 +222,19 @@ RRScreenSetSizeRange (ScreenPtr	pScreen,
 
     if (!pScrPriv)
 	return;
+    if (pScrPriv->minWidth == minWidth && pScrPriv->minHeight == minHeight &&
+	pScrPriv->maxWidth == maxWidth && pScrPriv->maxHeight == maxHeight)
+    {
+	return;
+    }
+	
     pScrPriv->minWidth  = minWidth;
     pScrPriv->minHeight = minHeight;
     pScrPriv->maxWidth  = maxWidth;
     pScrPriv->maxHeight = maxHeight;
+    pScrPriv->changed = TRUE;
+    pScrPriv->configChanged = TRUE;
 }
-#endif
 
 #ifdef RANDR_10_INTERFACE
 static Bool
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index 8ee126a..7b0fbb8 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -239,7 +239,8 @@ ProcRRGetScreenSizeRange (ClientPtr clie
     
     if (pScrPriv) 
     {
-	RRGetInfo (pScreen);
+	if (!RRGetInfo (pScreen))
+	    return BadAlloc;
 	rep.minWidth  = pScrPriv->minWidth;
 	rep.minHeight = pScrPriv->minHeight;
 	rep.maxWidth  = pScrPriv->maxWidth;
@@ -359,7 +360,8 @@ ProcRRGetScreenResources (ClientPtr clie
     rep.pad = 0;
     
     if (pScrPriv)
-	RRGetInfo (pScreen);
+	if (!RRGetInfo (pScreen))
+	    return BadAlloc;
 
     if (!pScrPriv)
     {
@@ -603,7 +605,8 @@ ProcRRGetScreenInfo (ClientPtr client)
     rep.pad = 0;
     
     if (pScrPriv)
-	RRGetInfo (pScreen);
+	if (!RRGetInfo (pScreen))
+	    return BadAlloc;
 
     output = RRFirstOutput (pScreen);
     



More information about the xorg-commit mailing list