2012-07-27 [ticho] 3.8.1cvs22
[claws.git] / src / textview.c
index baa21fea8b4dbb3d0860ffe1728917074f37c538..15477a6629adc7bf2809a7b4d8f4bce254b29526 100644 (file)
@@ -74,6 +74,7 @@
 #include "inputdialog.h"
 #include "timing.h"
 #include "tags.h"
+#include "manage_window.h"
 
 static GdkColor quote_colors[3] = {
        {(gulong)0, (gushort)0, (gushort)0, (gushort)0},
@@ -3060,6 +3061,8 @@ static void save_file_cb (GtkAction *action, TextView *textview)
        gchar *filepath = NULL;
        gchar *filedir = NULL;
        gchar *tmp_filename = NULL;
+       GtkWidget *window;
+
        if (uri == NULL)
                return;
 
@@ -3084,6 +3087,14 @@ static void save_file_cb (GtkAction *action, TextView *textview)
 
        g_free(filename);
 
+       /* Pick correct window to set the file dialog "transient for" */
+       if (textview->messageview->window != NULL)
+               window = textview->messageview->window;
+       else
+               window = textview->messageview->mainwin->window;
+
+       manage_window_focus_in(window, NULL, NULL);
+
        filename = filesel_select_file_save(_("Save as"), filepath);
        if (!filename) {
                g_free(filepath);