Description: Fall back to XF86VM gamma fade if XRANDR gamma fade is not supported
Author: Chris Coulson <chrisccoulson@ubuntu.com>
Bug-Ubuntu: https://bugs.edge.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/522806

diff -Nur -x '*.orig' -x '*~' gnome-screensaver-2.29.90/src/gs-fade.c gnome-screensaver-2.29.90.new/src/gs-fade.c
--- gnome-screensaver-2.29.90/src/gs-fade.c	2010-02-16 22:41:37.233254048 +0000
+++ gnome-screensaver-2.29.90.new/src/gs-fade.c	2010-02-16 22:52:43.700769263 +0000
@@ -573,6 +573,10 @@
         GdkDisplay *display = gdk_display_get_default ();
         GdkScreen *screen = gdk_display_get_screen (display, screen_idx);
         struct GSFadeScreenPrivate *screen_priv;
+        GnomeRRCrtc **crtcs;
+        GnomeRRCrtc *crtc;
+        gboolean res;
+        int gamma_size;
 
         screen_priv = &fade->priv->screen_priv[screen_idx];
 
@@ -585,6 +589,19 @@
                 return;
         }
 
+        crtcs = gnome_rr_screen_list_crtcs (screen_priv->rrscreen);
+
+        while (*crtcs)
+        {
+                crtc = *crtcs;
+                res = gnome_rr_crtc_get_gamma (crtc, &gamma_size, NULL, NULL, NULL);
+                if (res == FALSE || gamma_size == 0) {
+                        screen_priv->fade_type = FADE_TYPE_NONE;
+                        return;                
+                }
+                crtcs++;
+        }
+
         screen_priv->fade_type = FADE_TYPE_XRANDR;
         screen_priv->fade_setup = xrandr_fade_setup;
         screen_priv->fade_finish = screen_fade_finish;
