# HG changeset patch # User gqview # Date 1162061378 0 # Node ID b3149a34d0ddb879674bd87ed87ce9a2312c6b5e # Parent 2099ee3f9a8d7c034a1a2fdc8d9c79ca3b2231be Sat Oct 28 14:41:10 2006 John Ellis * img-view.c: Use correct method to close the window using Escape key, fixes bug #1231845. Also added more robust method to update window list when a window is closed so this doesn't happen again. * slideshow.c: Add sanity checks to exported functions to check for NULL SlideShow pointers, to match rest of coding style. diff -r 2099ee3f9a8d -r b3149a34d0dd ChangeLog --- a/ChangeLog Sat Oct 28 00:03:15 2006 +0000 +++ b/ChangeLog Sat Oct 28 18:49:38 2006 +0000 @@ -1,3 +1,11 @@ +Sat Oct 28 14:41:10 2006 John Ellis + + * img-view.c: Use correct method to close the window using Escape key, + fixes bug #1231845. Also added more robust method to update window + list when a window is closed so this doesn't happen again. + * slideshow.c: Add sanity checks to exported functions to check for + NULL SlideShow pointers, to match rest of coding style. + Fri Oct 27 19:45:32 2006 John Ellis * layout.c, ui_menu.c, ui_misc.c: Use g_object_ref_sink when diff -r 2099ee3f9a8d -r b3149a34d0dd TODO --- a/TODO Sat Oct 28 00:03:15 2006 +0000 +++ b/TODO Sat Oct 28 18:49:38 2006 +0000 @@ -4,6 +4,10 @@ Major: ---------------------------------------------- + > figure out if crash when expanding a folder in the folder tree view then pessing "*" is a bug + GTK+ 2.10.4 (gdb shows it deep inside gtk, near gtk_tree_view_set_hover_selection()). This does not + happen on GTK+ 2.6. + > pixbuf-renderer.c: > tile dispose order is slightly incorrect, furthest ones from current position should be dropped first @@ -125,6 +129,9 @@ Wishlist?: ---------------------------------------------- + > Explore tabbed view option to main window, where 'view in new window' option results + in a new tab instead of window. + > Initiating full screen from the command line should not show main window until full screen is exited. diff -r 2099ee3f9a8d -r b3149a34d0dd src/img-view.c --- a/src/img-view.c Sat Oct 28 00:03:15 2006 +0000 +++ b/src/img-view.c Sat Oct 28 18:49:38 2006 +0000 @@ -558,7 +558,7 @@ } else { - gtk_widget_destroy(vw->window); + view_window_close(vw); } break; case GDK_Menu: @@ -767,15 +767,24 @@ if (vw->ss) slideshow_free(vw->ss); } -static void view_window_close(ViewWindow *vw) +static void view_window_destroy_cb(GtkWidget *widget, gpointer data) { + ViewWindow *vw = data; + view_window_list = g_list_remove(view_window_list, vw); view_slideshow_stop(vw); + fullscreen_stop(vw->fs); + + path_list_free(vw->list); + g_free(vw); +} + +static void view_window_close(ViewWindow *vw) +{ + view_slideshow_stop(vw); view_fullscreen_toggle(vw, TRUE); gtk_widget_destroy(vw->window); - path_list_free(vw->list); - g_free(vw); } static gint view_window_delete_cb(GtkWidget *w, GdkEventAny *event, gpointer data) @@ -832,6 +841,8 @@ view_image_set_buttons(vw, vw->imd); + g_signal_connect(G_OBJECT(vw->window), "destroy", + G_CALLBACK(view_window_destroy_cb), vw); g_signal_connect(G_OBJECT(vw->window), "delete_event", G_CALLBACK(view_window_delete_cb), vw); g_signal_connect(G_OBJECT(vw->window), "key_press_event", diff -r 2099ee3f9a8d -r b3149a34d0dd src/slideshow.c --- a/src/slideshow.c Sat Oct 28 00:03:15 2006 +0000 +++ b/src/slideshow.c Sat Oct 28 18:49:38 2006 +0000 @@ -25,6 +25,8 @@ void slideshow_free(SlideShowData *ss) { + if (!ss) return; + slideshow_timer_reset(ss, FALSE); if (ss->stop_func) ss->stop_func(ss, ss->stop_data); @@ -118,6 +120,8 @@ const gchar *imd_path; const gchar *path; + if (!ss) return FALSE; + imd_path = image_get_path(ss->imd); if ( ((imd_path == NULL) != (ss->slide_path == NULL)) || @@ -284,6 +288,8 @@ void slideshow_next(SlideShowData *ss) { + if (!ss) return; + if (!slideshow_step(ss, TRUE)) { slideshow_free(ss); @@ -295,6 +301,8 @@ void slideshow_prev(SlideShowData *ss) { + if (!ss) return; + if (!slideshow_step(ss, FALSE)) { slideshow_free(ss);