gnome-screensaver r1439 - in trunk: . src



Author: mccann
Date: Mon May 12 21:31:24 2008
New Revision: 1439
URL: http://svn.gnome.org/viewvc/gnome-screensaver?rev=1439&view=rev

Log:
2008-05-12  William Jon McCann  <jmccann redhat com>

	* src/gs-fade.c (gamma_info_init), (gs_fade_set_alpha_gamma),
	(gs_fade_start), (gs_fade_reset), (gs_fade_init):
	Restore the value to the one that was used before
	blanking the screen.
	Patch from: John Bryant <bryantk sover net>
	Fixes #342850



Modified:
   trunk/ChangeLog
   trunk/src/gs-fade.c

Modified: trunk/src/gs-fade.c
==============================================================================
--- trunk/src/gs-fade.c	(original)
+++ trunk/src/gs-fade.c	Mon May 12 21:31:24 2008
@@ -296,6 +296,10 @@
         }
 # endif
 
+        if (fade->priv->gamma_info != NULL) {
+                return TRUE;
+        }
+
         info = g_new0 (xf86_gamma_info, fade->priv->num_screens);
         fade->priv->gamma_info = info;
 
@@ -402,8 +406,10 @@
         int      screen;
         gboolean res;
 
-        for (screen = 0; screen < fade->priv->num_screens; screen++) {
-                res = xf86_whack_gamma (screen, &fade->priv->gamma_info [screen], alpha);
+        if (fade->priv->gamma_info != NULL) {
+                for (screen = 0; screen < fade->priv->num_screens; screen++) {
+                        res = xf86_whack_gamma (screen, &fade->priv->gamma_info [screen], alpha);
+                }
         }
 
         return TRUE;
@@ -523,6 +529,8 @@
 
         g_return_if_fail (GS_IS_FADE (fade));
 
+        gamma_info_init (fade);
+
         if (fade->priv->timer_id > 0) {
                 gs_fade_stop (fade);
         }
@@ -641,6 +649,8 @@
         fade->priv->current_alpha = 1.0;
 
         gs_fade_set_alpha (fade, fade->priv->current_alpha);
+
+        gamma_info_free (fade);
 }
 
 static void
@@ -681,7 +691,9 @@
         display = gdk_display_get_default ();
         fade->priv->num_screens = gdk_display_get_n_screens (display);
 
-        gamma_info_init (fade);
+#ifdef HAVE_XF86VMODE_GAMMA
+        fade->priv->gamma_info = NULL;
+#endif
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]