Fixed segfault when closing LDIF import window with the window manager.
authorSergey Vlasov <vsu@users.sourceforge.net>
Wed, 23 Jan 2002 17:58:56 +0000 (17:58 +0000)
committerSergey Vlasov <vsu@users.sourceforge.net>
Wed, 23 Jan 2002 17:58:56 +0000 (17:58 +0000)
Fixed wrong scrolling position when switching between text and image parts.

ChangeLog.claws
configure.in
src/imageview.c
src/imageview.h
src/importldif.c
src/messageview.c
src/mimeview.c

index 08b21e5..aaa1a20 100644 (file)
@@ -1,3 +1,15 @@
+2002-01-23 [sergey]    0.7.0claws23
+
+       * src/importldif.c
+               Fixed segfault when closing LDIF import wizard with
+               the window manager.
+       * src/imageview.c
+       * src/imageview.h
+       * src/messageview.c
+       * src/mimeview.c
+               Fixed wrong scrolling position after switching between
+               text and image parts.
+
 2002-01-23 [paul]      0.7.0claws22
 
        * sync with sylpheed 0.7.0cvs15
index 4af778e..bb3babb 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws22
+EXTRA_VERSION=claws23
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index a1f7243..aeb4b95 100644 (file)
@@ -152,6 +152,20 @@ void imageview_show_image(ImageView *imageview, MimeInfo *mimeinfo,
 #endif /* HAVE_GDK_IMLIB */
 #endif /* HAVE_GDK_PIXBUF */
 
+void imageview_clear(ImageView *imageview)
+{
+       GtkAdjustment *hadj, *vadj;
+
+       if (imageview->image)
+               gtk_pixmap_set(GTK_PIXMAP(imageview->image), NULL, NULL);
+       hadj = gtk_scrolled_window_get_hadjustment
+               (GTK_SCROLLED_WINDOW(imageview->scrolledwin));
+       gtk_adjustment_set_value(hadj, 0.0);
+       vadj = gtk_scrolled_window_get_vadjustment
+               (GTK_SCROLLED_WINDOW(imageview->scrolledwin));
+       gtk_adjustment_set_value(vadj, 0.0);
+}
+
 void imageview_destroy(ImageView *imageview)
 {
        g_free(imageview);
index ab0c42d..175f625 100644 (file)
@@ -41,6 +41,7 @@ void imageview_init           (ImageView      *imageview);
 void imageview_show_image      (ImageView      *imageview,
                                 MimeInfo       *mimeinfo,
                                 const gchar    *file);
+void imageview_clear           (ImageView      *imageview);
 void imageview_destroy         (ImageView      *imageview);
 
 #endif /* __IMAGEVIEW_H__ */
index c2983b8..ddc3a6b 100644 (file)
@@ -461,8 +461,8 @@ static void imp_ldif_file_select( void ) {
        gtk_grab_add( _imp_ldif_file_selector_.fileSelector );
 }
 
-static gint imp_ldif_delete_event( GtkWidget *widget, GdkEventAny *event, gboolean *cancelled ) {
-       *cancelled = TRUE;
+static gint imp_ldif_delete_event( GtkWidget *widget, GdkEventAny *event, gpointer data ) {
+       impldif_dlg.cancelled = TRUE;
        gtk_main_quit();
        return TRUE;
 }
index e19ef9e..1a54113 100644 (file)
@@ -510,6 +510,7 @@ void messageview_clear(MessageView *messageview)
        messageview_change_view_type(messageview, MVIEW_TEXT);
        headerview_clear(messageview->headerview);
        textview_clear(messageview->textview);
+       imageview_clear(messageview->imageview);
 }
 
 void messageview_destroy(MessageView *messageview)
index 74616bf..9b079a9 100644 (file)
@@ -431,6 +431,9 @@ static void mimeview_show_image_part(MimeView *mimeview, MimeInfo *partinfo)
                        (_("Can't get the part of multipart message."));
        else {
                mimeview_change_view_type(mimeview, MIMEVIEW_IMAGE);
+               /* Workaround for the GTK+ bug with handling scroll adjustments
+                * in GtkViewport */
+               imageview_clear(mimeview->imageview);
                imageview_show_image(mimeview->imageview, partinfo, filename);
                unlink(filename);
        }
@@ -474,6 +477,7 @@ static void mimeview_clear(MimeView *mimeview)
 
        gtk_clist_clear(clist);
        textview_clear(mimeview->textview);
+       imageview_clear(mimeview->imageview);
 
        mimeview->opened = NULL;