[fusion-commits] compiz mirror: Changes to 'master' (9263fb349f05a496e76cacfb7527b7a6f1fff319)

compiz at server.beryl-project.org compiz at server.beryl-project.org
Wed Jul 25 00:57:05 CEST 2007


New commits:
commit 9263fb349f05a496e76cacfb7527b7a6f1fff319
Author: David Reveman <davidr at novell.com>
Date:   Tue Jul 24 18:55:58 2007 -0400

    Make server-side RANDR support optional.


 include/compiz.h |    6 ++++--
 src/display.c    |   11 ++++-------
 src/event.c      |    3 ++-
 src/screen.c     |   20 +++++++++++++-------
 4 files changed, 23 insertions(+), 17 deletions(-)


Modified: compiz/include/compiz.h
===================================================================
--- compiz/include/compiz.h
+++ compiz/include/compiz.h
@@ -26,7 +26,7 @@
 #ifndef _COMPIZ_H
 #define _COMPIZ_H
 
-#define ABIVERSION 20070707
+#define ABIVERSION 20070708
 
 #include <stdio.h>
 #include <sys/time.h>
@@ -740,10 +740,12 @@ struct _CompDisplay {
 
     int compositeEvent, compositeError, compositeOpcode;
     int damageEvent, damageError;
-    int randrEvent, randrError;
     int syncEvent, syncError;
     int fixesEvent, fixesError, fixesVersion;
 
+    Bool randrExtension;
+    int randrEvent, randrError;
+
     Bool shapeExtension;
     int  shapeEvent, shapeError;
 

Modified: compiz/src/display.c
===================================================================
--- compiz/src/display.c
+++ compiz/src/display.c
@@ -2227,13 +2227,6 @@ addDisplay (char *name)
 	return FALSE;
     }
 
-    if (!XRRQueryExtension (dpy, &d->randrEvent, &d->randrError))
-    {
-	compLogMessage (d, "core", CompLogLevelFatal,
-			"No RandR extension");
-	return FALSE;
-    }
-
     if (!XSyncQueryExtension (dpy, &d->syncEvent, &d->syncError))
     {
 	compLogMessage (d, "core", CompLogLevelFatal,
@@ -2257,6 +2250,10 @@ addDisplay (char *name)
     }
     */
 
+    d->randrExtension = XRRQueryExtension (dpy,
+					   &d->randrEvent,
+					   &d->randrError);
+
     d->shapeExtension = XShapeQueryExtension (dpy,
 					      &d->shapeEvent,
 					      &d->shapeError);

Modified: compiz/src/event.c
===================================================================
--- compiz/src/event.c
+++ compiz/src/event.c
@@ -2125,7 +2125,8 @@ handleEvent (CompDisplay *d,
 		}
 	    }
 	}
-	else if (event->type == d->randrEvent + RRScreenChangeNotify)
+	else if (d->randrExtension &&
+		 event->type == d->randrEvent + RRScreenChangeNotify)
 	{
 	    XRRScreenChangeNotifyEvent *rre;
 

Modified: compiz/src/screen.c
===================================================================
--- compiz/src/screen.c
+++ compiz/src/screen.c
@@ -977,18 +977,24 @@ detectRefreshRateOfScreen (CompScreen *s)
 {
     if (!noDetection && s->opt[COMP_SCREEN_OPTION_DETECT_REFRESH_RATE].value.b)
     {
-	XRRScreenConfiguration *config;
-	char		       *name;
-	CompOptionValue	       value;
+	char		*name;
+	CompOptionValue	value;
+
+	value.i = 0;
+
+	if (s->display->randrExtension)
+	{
+	    XRRScreenConfiguration *config;
+
+	    config  = XRRGetScreenInfo (s->display->display, s->root);
+	    value.i = (int) XRRConfigCurrentRate (config);
 
-	config  = XRRGetScreenInfo (s->display->display, s->root);
-	value.i = (int) XRRConfigCurrentRate (config);
+	    XRRFreeScreenConfigInfo (config);
+	}
 
 	if (value.i == 0)
 	    value.i = defaultRefreshRate;
 
-	XRRFreeScreenConfigInfo (config);
-
 	name = s->opt[COMP_SCREEN_OPTION_REFRESH_RATE].name;
 
 	s->opt[COMP_SCREEN_OPTION_DETECT_REFRESH_RATE].value.b = FALSE;


More information about the commits mailing list