From df499f89bec731829f6b9adcf7376b0689a4adb2 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Tue, 22 Oct 2013 21:00:48 +0200 Subject: screenshot: do not segfault when taking a window picture with no delay --- mate-screenshot/mate-screenshot.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mate-screenshot/mate-screenshot.c b/mate-screenshot/mate-screenshot.c index f3db5794..77ceb3af 100644 --- a/mate-screenshot/mate-screenshot.c +++ b/mate-screenshot/mate-screenshot.c @@ -1368,8 +1368,17 @@ main (int argc, char *argv[]) } else { - /* start this in an idle anyway and fire up the mainloop */ - g_idle_add (prepare_screenshot_timeout, NULL); + if (interactive_arg) + { + /* HACK: give time to the dialog to actually disappear. + * We don't have any way to tell when the compositor has finished + * re-drawing. + */ + g_timeout_add (200, + prepare_screenshot_timeout, NULL); + } + else + g_idle_add (prepare_screenshot_timeout, NULL); } gtk_main (); -- cgit v1.2.1