[Xfce4-commits] <xfce4-screenshooter:master> Remove the ugly sleep one second workaround.
Jérôme Guelfucci
jeromeg at xfce.org
Fri Aug 14 00:26:06 CEST 2009
Updating branch refs/heads/master
to 7ad0211b03b6623efef7e172fca018d61c713f99 (commit)
from 61df0c326ae507884203086c6662399087c1b7f9 (commit)
commit 7ad0211b03b6623efef7e172fca018d61c713f99
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date: Sun Aug 2 09:00:30 2009 +0200
Remove the ugly sleep one second workaround.
Now that the idle func no longer creates the dialog, it shouldn't
be needed anymore. This needs some testing on a low computer.
ChangeLog | 7 +++++++
lib/screenshooter-capture.c | 8 +++-----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3a4a7ab..58ffcb0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,13 @@ Updated Italian and Galician documentation translation.
2009-08-02 jeromeg
+Remove the ugly sleep one second workaround.
+
+Now that the idle func no longer creates the dialog, it shouldn't
+be needed anymore. This needs some testing on a low computer.
+
+2009-08-02 jeromeg
+
Simplify (screenshooter_take_and_output_screenshot).
Now, the main dialog of the application is created once in main.c
diff --git a/lib/screenshooter-capture.c b/lib/screenshooter-capture.c
index 9a55089..9f35d04 100644
--- a/lib/screenshooter-capture.c
+++ b/lib/screenshooter-capture.c
@@ -462,10 +462,8 @@ GdkPixbuf *screenshooter_take_screenshot (gint region, gint delay, gboolean show
gdk_display_sync (display);
/* wait for n=delay seconds */
- /* WORKAROUND: always sleep at least 1 second so that
- * the dialog has the time to disappear. */
if (region != SELECT)
- (delay > 0) ? sleep (delay) : sleep (1);
+ sleep (delay);
/* Get the window/desktop we want to screenshot*/
if (region == FULLSCREEN)
@@ -489,7 +487,7 @@ GdkPixbuf *screenshooter_take_screenshot (gint region, gint delay, gboolean show
screenshot = get_window_screenshot (window, show_mouse);
if (needs_unref)
- g_object_unref (window);
+ g_object_unref (window);
}
else if (region == SELECT)
{
@@ -499,5 +497,5 @@ GdkPixbuf *screenshooter_take_screenshot (gint region, gint delay, gboolean show
}
- return screenshot;
+ return screenshot;
}
More information about the Xfce4-commits
mailing list