fix 'View->Open in new window' bug
authorPaul Mangan <paul@claws-mail.org>
Wed, 8 May 2002 06:27:40 +0000 (06:27 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 8 May 2002 06:27:40 +0000 (06:27 +0000)
ChangeLog.claws
configure.in
src/messageview.c
src/textview.c
src/textview.h

index 27a7222f2865861595b5083a6c3323780533c0d0..092be1d594a524b3b4173aaa2468e2d8979cd5d4 100644 (file)
@@ -1,3 +1,10 @@
+2002-05-08 [paul]      0.7.5claws12
+
+       * src/mainwindow.c
+         src/textview.[ch]
+               fix segfault on View->Open in new window
+               patch submitted by Thorsten Maerz <torte@netztorte.de>
+
 2002-05-07 [paul]      0.7.5claws11
 
        * sync with 0.7.5cvs9
index b0500b5fd66e471da93985190fddcf0efc8d7b41..f997941733d7f299626f578ef596f3d40a8b34ad 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws11
+EXTRA_VERSION=claws12
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 1ecfef805b4d4553bb81f7d1b28ba5e16043c988..4c5e5f6e1d28b797987e8fe7d01d1798e45cfe57 100644 (file)
@@ -375,9 +375,6 @@ void messageview_show(MessageView *messageview, MsgInfo *msginfo,
 
        g_return_if_fail(msginfo != NULL);
 
-       gtk_statusbar_pop(GTK_STATUSBAR(messageview->mainwin->statusbar),
-                         messageview->mainwin->folderview_cid);
-
 #if USE_GPGME
        if ((fp = procmsg_open_message_decrypted(msginfo, &mimeinfo)) == NULL)
                return;
index baa9f1cc524e68582c1044cf3f0ab5b6f48dd04f..7390889ff80e47320957a8b4b8853fade7b5e19a 100644 (file)
@@ -257,6 +257,7 @@ TextView *textview_create(void)
        textview->cur_pos          = 0;
        textview->show_all_headers = FALSE;
        textview->last_buttonpress = GDK_NOTHING;
+       textview->show_url_msgid   = 0;
 
        return textview;
 }
@@ -1641,6 +1642,16 @@ static gint textview_key_pressed(GtkWidget *widget, GdkEventKey *event,
        return TRUE;
 }
 
+static gint show_url_timeout_cb(TextView    *textview ){
+       if (textview->messageview->mainwin)
+               if (textview->show_url_msgid)
+                       gtk_statusbar_remove(GTK_STATUSBAR(
+                               textview->messageview->mainwin->statusbar),
+                               textview->messageview->mainwin->folderview_cid,
+                               textview->show_url_msgid);
+               return FALSE;
+}
+
 static gint textview_button_pressed(GtkWidget *widget, GdkEventButton *event,
                                    TextView *textview)
 {
@@ -1667,21 +1678,30 @@ static gint textview_button_released(GtkWidget *widget, GdkEventButton *event,
                        textview->cur_pos--;
                }
 
-               gtk_statusbar_pop(GTK_STATUSBAR(textview->messageview->mainwin->statusbar),
-                                 textview->messageview->mainwin->folderview_cid);
-
                for (cur = textview->uri_list; cur != NULL; cur = cur->next) {
                        RemoteURI *uri = (RemoteURI *)cur->data;
 
                        if (textview->cur_pos >= uri->start &&
                            textview->cur_pos <  uri->end) {
                                /* single click: display url in statusbar */
-                               if (event->button == 1 
-                                   && (textview->last_buttonpress != GDK_2BUTTON_PRESS)) {
-                                       gtk_statusbar_push(
-                                               GTK_STATUSBAR(textview->messageview->mainwin->statusbar),
-                                               textview->messageview->mainwin->folderview_cid, uri->uri);
-                                       gtkut_widget_wait_for_draw(textview->messageview->mainwin->hbox_stat);
+                               if (event->button == 1) {
+                                       if (textview->messageview->mainwin
+                                       && textview->last_buttonpress != GDK_2BUTTON_PRESS) {
+                                               if (textview->show_url_msgid) {
+                                                       gtk_timeout_remove(textview->show_url_timeout_tag);
+                                                       gtk_statusbar_remove(GTK_STATUSBAR(
+                                                               textview->messageview->mainwin->statusbar),
+                                                               textview->messageview->mainwin->folderview_cid,
+                                                               textview->show_url_msgid);
+                                                       textview->show_url_msgid = 0;
+                                               }
+                                               textview->show_url_msgid = gtk_statusbar_push(
+                                                               GTK_STATUSBAR(textview->messageview->mainwin->statusbar),
+                                                               textview->messageview->mainwin->folderview_cid,
+                                                               uri->uri);
+                                               textview->show_url_timeout_tag = gtk_timeout_add( 2000, show_url_timeout_cb, textview );
+                                               gtkut_widget_wait_for_draw(textview->messageview->mainwin->hbox_stat);
+                                       }
                                } else
                                if (!g_strncasecmp(uri->uri, "mailto:", 7)) {
                                        if (event->button == 3) {
index 49f33bc0ece5fde188ceed91ca27ad3ef79396cf..d8b819496ad77939a992e36f271969c293dbec79 100644 (file)
@@ -58,6 +58,8 @@ struct _TextView
 
        MessageView *messageview;
        gint last_buttonpress;
+       gint show_url_msgid;
+       gint show_url_timeout_tag;
 };
 
 TextView *textview_create      (void);