X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fhildon2%2Fmodest-hildon2-window-mgr.c;fp=src%2Fhildon2%2Fmodest-hildon2-window-mgr.c;h=e972e449bf51c945b3a8d320de54b45779e6bf80;hp=936cc702d53cd40cb797fd306bfbd4f6b82e97bf;hb=bf73e6d4cafc7915d75baf18640e5aeb4753e02f;hpb=2c7c0e311cf57d4c11d1666b04533cca6a00a880;ds=sidebyside diff --git a/src/hildon2/modest-hildon2-window-mgr.c b/src/hildon2/modest-hildon2-window-mgr.c index 936cc70..e972e44 100644 --- a/src/hildon2/modest-hildon2-window-mgr.c +++ b/src/hildon2/modest-hildon2-window-mgr.c @@ -512,13 +512,21 @@ modest_hildon2_window_mgr_register_window (ModestWindowMgr *self, } /* Rules - * * toplevel = msg edit -> no action + * * toplevel = msg edit -> if not modified, close, if modified, stay * * same account -> no action * * window = accounts -> no action * * window = folders, mailboxes, headers: close all up to accounts window */ - if (MODEST_IS_MSG_EDIT_WINDOW (current_top) || + if (MODEST_IS_MSG_EDIT_WINDOW (current_top) && + !modest_msg_edit_window_is_modified (MODEST_MSG_EDIT_WINDOW (current_top))) { + gboolean retval; + + g_signal_emit_by_name (G_OBJECT (current_top), "delete-event", NULL, &retval); + current_top = (ModestWindow *) hildon_window_stack_peek (stack); + } + + if (MODEST_IS_MSG_EDIT_WINDOW (current_top) || (current_top && MODEST_IS_ACCOUNTS_WINDOW (window))) { gtk_window_present (GTK_WINDOW (current_top)); return FALSE;