From 616a367bc8ad211a1d61b3b13f48f5c278eba521 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 8 Jul 2003 10:38:13 +0000 Subject: [PATCH] don't ignore the delete event on the splash screen, but quit gimp 2003-07-08 Sven Neumann * app/gui/splash.c (splash_create): don't ignore the delete event on the splash screen, but quit gimp immidiately by calling exit(). * app/xcf/xcf-load.c (xcf_load_layer): reduced code duplication. --- ChangeLog | 7 ++++++ app/gui/splash.c | 6 ++++-- app/xcf/xcf-load.c | 53 +++++++++++++++++----------------------------- 3 files changed, 30 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6affca6b98..46e54805f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-07-08 Sven Neumann + + * app/gui/splash.c (splash_create): don't ignore the delete event + on the splash screen, but quit gimp immidiately by calling exit(). + + * app/xcf/xcf-load.c (xcf_load_layer): reduced code duplication. + 2003-07-08 Sven Neumann * app/gui/file-commands.c (file_save_cmd_callback): warn if the diff --git a/app/gui/splash.c b/app/gui/splash.c index bca0aa75b0..fa4082c396 100644 --- a/app/gui/splash.c +++ b/app/gui/splash.c @@ -18,6 +18,8 @@ #include "config.h" +#include + #include #include "libgimpbase/gimpbase.h" @@ -58,8 +60,8 @@ splash_create (gboolean show_image) gtk_window_set_position (GTK_WINDOW (win_initstatus), GTK_WIN_POS_CENTER); gtk_window_set_resizable (GTK_WINDOW (win_initstatus), FALSE); - g_signal_connect (win_initstatus, "delete_event", - G_CALLBACK (gtk_true), NULL); + g_signal_connect_swapped (win_initstatus, "delete_event", + G_CALLBACK (exit), GINT_TO_POINTER (0)); /* we don't want the splash screen to send the startup notification */ gtk_window_set_auto_startup_notification (FALSE); diff --git a/app/xcf/xcf-load.c b/app/xcf/xcf-load.c index ddf37ec9b0..869b36372b 100644 --- a/app/xcf/xcf-load.c +++ b/app/xcf/xcf-load.c @@ -757,6 +757,7 @@ xcf_load_layer (XcfInfo *info, gint type; gint add_floating_sel; gchar *name; + GimpText *text = NULL; /* check and see if this is the drawable the floating selection * is attached to. if it is then we'll do the attachment at @@ -787,23 +788,11 @@ xcf_load_layer (XcfInfo *info, gimp_text_parasite_name ()); if (parasite) { - GimpText *text = gimp_text_from_parasite (parasite); + text = gimp_text_from_parasite (parasite); if (text) - { - gboolean active; - - gimp_parasite_list_remove (GIMP_ITEM (layer)->parasites, - gimp_parasite_name (parasite)); - - active = (info->active_layer == layer); - - /* convert the layer to a text layer */ - layer = gimp_text_layer_from_layer (layer, text); - - if (active) - info->active_layer = layer; - } + gimp_parasite_list_remove (GIMP_ITEM (layer)->parasites, + gimp_parasite_name (parasite)); } else { @@ -812,20 +801,21 @@ xcf_load_layer (XcfInfo *info, gimp_text_gdyntext_parasite_name ()); if (parasite) - { - GimpText *text = gimp_text_from_gdyntext_parasite (parasite); + text = gimp_text_from_gdyntext_parasite (parasite); + } - if (text) - { - gboolean active = (info->active_layer == layer); - - /* convert the layer to a text layer */ - layer = gimp_text_layer_from_layer (layer, text); - - if (active) - info->active_layer = layer; - } - } + /* if there's a text object, convert the layer to a text layer */ + if (text) + { + gboolean active = (info->active_layer == layer); + gboolean floating = (info->floating_sel == layer); + + layer = gimp_text_layer_from_layer (layer, text); + + if (active) + info->active_layer = layer; + if (floating) + info->floating_sel = layer; } /* read the hierarchy and layer mask offsets */ @@ -863,12 +853,7 @@ xcf_load_layer (XcfInfo *info, /* attach the floating selection... */ if (add_floating_sel) - { - GimpLayer *floating_sel; - - floating_sel = info->floating_sel; - floating_sel_attach (floating_sel, GIMP_DRAWABLE (layer)); - } + floating_sel_attach (info->floating_sel, GIMP_DRAWABLE (layer)); return layer;