sync with 0.7.6cvs24
[claws.git] / src / compose.c
index cc3b6f8b304cb6bdd971aa4e8be3d977bef7784d..2366e2dad70d40ac39e96da3edc140c65e5681fa 100644 (file)
@@ -734,6 +734,7 @@ Compose *compose_new_with_folderitem(PrefsAccount *account, FolderItem *item)
 Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderItem *item)
 {
        Compose *compose;
+       GtkSText *text;
 
        if (item && item->prefs && item->prefs->enable_default_account)
                account = account_find_from_id(item->prefs->default_account);
@@ -744,10 +745,19 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
        compose = compose_create(account, COMPOSE_NEW);
        compose->replyinfo = NULL;
 
+       text = GTK_STEXT(compose->text);
+       gtk_stext_freeze(text);
+
        if (prefs_common.auto_sig)
                compose_insert_sig(compose);
-       gtk_editable_set_position(GTK_EDITABLE(compose->text), 0);
-       gtk_stext_set_point(GTK_STEXT(compose->text), 0);
+       gtk_editable_set_position(GTK_EDITABLE(text), 0);
+       gtk_stext_set_point(text, 0);
+
+       gtk_stext_thaw(text);
+
+       /* workaround for initial XIM problem */
+       gtk_widget_grab_focus(compose->text);
+       gtkut_widget_wait_for_draw(compose->text);
 
        if (account->protocol != A_NNTP) {
                if (mailto) {