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

[E-devel] entrance return from screen save bug



When DPMS is enabled in X, and the monitor is in a powersave mode,
entrance may be frozen after restoring the screen with a mouse move.
This is because multiple screen save events can occur with only one
screen save off event (e.g. dpms states normal -> standby -> suspend
-> off).
Patch below shows a fix I used.
--- main.c.orig	2006-08-28 18:24:23.000000000 -0700
+++ main.c	2006-10-13 16:31:22.000000000 -0700
@@ -24,6 +24,7 @@
 #define WINH 600
 
 static Entrance_Session *session = NULL;
+static int screensave_notify_count = 0;
 
 Ecore_Evas *setup_ecore_evas(int wx, int wy, int ww, int wh, int fullscreen);
 
@@ -91,6 +92,8 @@
 	
 	edje_object_play_set(edje, 0);
 	edje_freeze();
+	/* multiple on events could occur before an off (e.g. dpms). cliff */
+	screensave_notify_count++;
 	size = evas_image_cache_get(evas_object_evas_get(edje));
 	evas_image_cache_set(evas_object_evas_get(edje), 0);
 	evas_image_cache_set(evas_object_evas_get(edje), size);
@@ -102,7 +105,10 @@
      }
    else 
      {
-	edje_thaw();
+	while(screensave_notify_count) { /* cliff */
+	    edje_thaw();
+	    screensave_notify_count--;
+	}
 	edje_object_play_set(edje, 1);
      }
    return 1;