diff --git a/ChangeLog b/ChangeLog
index 24240a4295391f53b1402ce9fcf6a0a273f764d0..2d1f5a5b8dc29f680b6bfd940d63b7a635b624d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-06-05 jeromeg
+
+Try to fix bug #5424.
+
+Destroy the main dialog before doing anything else. Normally, this will
+prevent this dialog from remaining displayed on the screen and being
+captured instead of the active window.
+
 2009-06-03 jeromeg
 
 Add the autotools stuff for the Turkish translation.
diff --git a/lib/screenshooter-actions.c b/lib/screenshooter-actions.c
index ba10cfe939ab93a1961751c17b53ad53dfad2d03..40ba990c32b6527d4b44d24615c11d11c6a3b637 100644
--- a/lib/screenshooter-actions.c
+++ b/lib/screenshooter-actions.c
@@ -69,16 +69,11 @@ gboolean screenshooter_take_and_output_screenshot (ScreenshotData *sd)
       g_signal_connect (dialog, "response", (GCallback) cb_help_response, NULL);
 
       response = gtk_dialog_run (GTK_DIALOG (dialog));
+      gtk_widget_destroy (dialog);
 
-      if (response == GTK_RESPONSE_OK)
+      if (response != GTK_RESPONSE_OK)
         {
-          gtk_widget_hide (dialog);
-        }
-      else
-        {
-          gtk_widget_destroy (dialog);
           gtk_main_quit ();
-
           return FALSE;
         }
     }