* Fixes NB#95749, properly manage new windows
authorJose Dapena Paz <jdapena@igalia.com>
Fri, 19 Dec 2008 11:43:09 +0000 (11:43 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Fri, 19 Dec 2008 11:43:09 +0000 (11:43 +0000)
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
src/modest-ui-actions.c

index e279cc3..8c7548d 100644 (file)
@@ -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));
index 70a521d..518816e 100644 (file)
@@ -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;
        }