From 997a77e85fc94dd11eaa8abd13bcf4057a28e219 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Fri, 19 Dec 2008 11:43:09 +0000 Subject: [PATCH] * Fixes NB#95749, properly manage new windows This merge in dropsplitview integrates also the detection of nested windows from msg view. pmo-drop-split-view-r6946 --- src/hildon2/modest-hildon2-window-mgr.c | 42 +++++++++++++++---------------- src/modest-ui-actions.c | 2 +- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/hildon2/modest-hildon2-window-mgr.c b/src/hildon2/modest-hildon2-window-mgr.c index e279cc3..8c7548d 100644 --- a/src/hildon2/modest-hildon2-window-mgr.c +++ b/src/hildon2/modest-hildon2-window-mgr.c @@ -368,29 +368,27 @@ modest_hildon2_window_mgr_register_window (ModestWindowMgr *self, nested_msg = MODEST_IS_MSG_VIEW_WINDOW (window) && MODEST_IS_MSG_VIEW_WINDOW (parent); + /* Close views if they're being shown */ + if (!nested_msg && + (MODEST_IS_MSG_EDIT_WINDOW (current_top) || + MODEST_IS_MSG_VIEW_WINDOW (current_top))) { + gboolean retval; + + /* If the current view has modal dialogs then + we fail to register the new view */ + if ((current_top != NULL) && + window_has_modals (MODEST_WINDOW (current_top))) { + /* Window on top but it has opened dialogs */ + goto fail; + } - /* Close views if they're being shown. Nevertheless we must - allow nested messages */ - if (!nested_msg && - (MODEST_IS_MSG_EDIT_WINDOW (current_top) || - MODEST_IS_MSG_VIEW_WINDOW (current_top))) { - gboolean retval; - - /* If the current view has modal dialogs then - we fail to register the new view */ - if ((current_top != NULL) && - window_has_modals (MODEST_WINDOW (current_top))) { - /* Window on top but it has opened dialogs */ - goto fail; - } - - /* Close the current view */ - g_signal_emit_by_name (G_OBJECT (current_top), "delete-event", NULL, &retval); - if (retval == TRUE) { - /* Cancelled closing top window, then we fail to register */ - goto fail; - } - } + /* Close the current view */ + g_signal_emit_by_name (G_OBJECT (current_top), "delete-event", NULL, &retval); + if (retval == TRUE) { + /* Cancelled closing top window, then we fail to register */ + goto fail; + } + } /* Listen to object destruction */ handler_id = g_malloc0 (sizeof (gint)); diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 70a521d..518816e 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -795,7 +795,7 @@ modest_ui_actions_compose_msg(ModestWindow *win, allowed_size = MODEST_MAX_ATTACHMENT_SIZE; msg_win = modest_msg_edit_window_new (msg, account_name, FALSE); - if (!modest_window_mgr_register_window (modest_runtime_get_window_mgr(), msg_win, NULL)) { + if (!modest_window_mgr_register_window (modest_runtime_get_window_mgr(), msg_win, win)) { gtk_widget_destroy (GTK_WIDGET (msg_win)); goto cleanup; } -- 1.7.9.5