From 2dec43687802996c4ec7806b44550337e6a91def Mon Sep 17 00:00:00 2001 From: Alfons Hoogervorst Date: Mon, 21 Apr 2003 09:34:15 +0000 Subject: [PATCH] * src/main.c No access to GTK structures if we're a spawned child (and clean up code a little bit...) Should fix #126. --- ChangeLog.claws | 6 ++++++ configure.ac | 2 +- src/main.c | 32 +++++++++++++++++++++++++------- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index 90c13fc91..9a06443eb 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,9 @@ +2003-04-21 [alfons] 0.8.11claws105 + + * src/main.c + No access to GTK structures if we're a spawned child + (and clean up code a little bit...) Should fix #126. + 2003-04-21 [melvin] 0.8.11claws104 * src/plugins/dillo_viewer/README diff --git a/configure.ac b/configure.ac index 884436fc2..113144db0 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=8 MICRO_VERSION=11 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=claws104 +EXTRA_VERSION=claws105 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION dnl set $target diff --git a/src/main.c b/src/main.c index b7a7d7eef..fe2ccf50a 100644 --- a/src/main.c +++ b/src/main.c @@ -160,13 +160,14 @@ _("File `%s' already exists.\n" } static MainWindow *static_mainwindow; + int main(int argc, char *argv[]) { gchar *userrc; MainWindow *mainwin; FolderView *folderview; - if(!sylpheed_init(&argc, &argv)) { + if (!sylpheed_init(&argc, &argv)) { return 0; } @@ -501,10 +502,12 @@ static void initial_processing(FolderItem *item, gpointer data) static void draft_all_messages(void) { - GList * compose_list = compose_get_compose_list(); - GList * elem = NULL; - if(compose_list) { - for (elem = compose_list; elem != NULL && elem->data != NULL; elem = elem->next) { + GList *compose_list = compose_get_compose_list(); + GList *elem = NULL; + + if (compose_list) { + for (elem = compose_list; elem != NULL && elem->data != NULL; + elem = elem->next) { Compose *c = (Compose*)elem->data; compose_draft(c); } @@ -513,10 +516,25 @@ static void draft_all_messages(void) void clean_quit(void) { + /*!< Good idea to have the main window stored in a + * static variable so we can check that variable + * to see if we're really allowed to do things + * that actually the spawner is supposed to + * do (like: sending mail, composing messages). + * Because, really, if we're the spawnee, and + * we touch GTK stuff, we're hosed. See the + * next fixme. */ + + /* FIXME: Use something else to signal that we're + * in the original spawner, and not in a spawned + * child. */ + if (!static_mainwindow) + return; + draft_all_messages(); - if (prefs_common.warn_queued_on_exit) - { /* disable the popup */ + if (prefs_common.warn_queued_on_exit) { + /* disable the popup */ prefs_common.warn_queued_on_exit = FALSE; app_will_exit(NULL, static_mainwindow); prefs_common.warn_queued_on_exit = TRUE; -- 2.25.1