[Goodies-commits] r7462 - in xfce4-screenshooter/trunk: . lib

Jerome Guelfucci jeromeg at xfce.org
Fri Jun 5 22:07:16 CEST 2009


Author: jeromeg
Date: 2009-06-05 20:07:16 +0000 (Fri, 05 Jun 2009)
New Revision: 7462

Modified:
   xfce4-screenshooter/trunk/ChangeLog
   xfce4-screenshooter/trunk/lib/screenshooter-capture.c
Log:
Reimplement an old workaround to fix screenshots without delay.

If the delay is NULL, and under some vague conditions, there is
no active window detected. Waiting 1 second before doing anything is a
lame hack which fixes this issue.



Modified: xfce4-screenshooter/trunk/ChangeLog
===================================================================
--- xfce4-screenshooter/trunk/ChangeLog	2009-06-05 13:52:35 UTC (rev 7461)
+++ xfce4-screenshooter/trunk/ChangeLog	2009-06-05 20:07:16 UTC (rev 7462)
@@ -1,5 +1,13 @@
 2009-06-05 jeromeg
 
+Reimplement an old workaround to fix screenshots without delay.
+
+If the delay is NULL, and under some vague conditions, there is
+no active window detected. Waiting 1 second before doing anything is a
+lame hack which fixes this issue.
+
+2009-06-05 jeromeg
+
 Try to fix bug #5424.
 
 Destroy the main dialog before doing anything else. Normally, this will

Modified: xfce4-screenshooter/trunk/lib/screenshooter-capture.c
===================================================================
--- xfce4-screenshooter/trunk/lib/screenshooter-capture.c	2009-06-05 13:52:35 UTC (rev 7461)
+++ xfce4-screenshooter/trunk/lib/screenshooter-capture.c	2009-06-05 20:07:16 UTC (rev 7462)
@@ -457,8 +457,10 @@
   screen = gdk_screen_get_default ();
 
   /* wait for n=delay seconds */
+  /* WORKAROUND: always sleep at least 1 second so that
+   * the dialog has the time to disappear. */
   if (region != SELECT)
-    sleep (delay);
+    (delay > 0 ) ? sleep (delay): sleep (delay + 1);
 
   /* Get the window/desktop we want to screenshot*/
   if (region == FULLSCREEN)




More information about the Goodies-commits mailing list