From: Sergio Villar Senin Date: Wed, 16 Apr 2008 19:12:54 +0000 (+0000) Subject: * Removed the window management added to modest-main. Moved back to the window mgr X-Git-Tag: git_migration_finished~1456 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=1da44f9313cda2cd96051b9edfd0d6f09602084c * Removed the window management added to modest-main. Moved back to the window mgr pmo-trunk-r4423 --- diff --git a/src/modest-main.c b/src/modest-main.c index 2288c6f..269f06d 100644 --- a/src/modest-main.c +++ b/src/modest-main.c @@ -80,16 +80,12 @@ static void on_queue_empty (ModestMailOperationQueue *queue, gpointer user_data) { - guint num_windows = 0; ModestWindowMgr *mgr = modest_runtime_get_window_mgr (); - ModestWindow *main_win = modest_window_mgr_get_main_window (mgr, FALSE); /* Exit if the queue is empty and there are no more windows. We can exit as well if the main window is hidden and it's the only one */ - num_windows = modest_window_mgr_num_windows (mgr); - if ((num_windows == 0) || - (num_windows == 1 && main_win && !GTK_WIDGET_VISIBLE (main_win))) + if (modest_window_mgr_num_windows (mgr) == 0) g_idle_add_full (G_PRIORITY_LOW, on_idle_exit_modest, user_data, g_free); } diff --git a/src/widgets/modest-window-mgr.c b/src/widgets/modest-window-mgr.c index cf69517..81b70b8 100644 --- a/src/widgets/modest-window-mgr.c +++ b/src/widgets/modest-window-mgr.c @@ -808,7 +808,8 @@ on_window_destroy (ModestWindow *window, cancel_window_operations (window); /* Fake the window system, make it think that there is no window */ - g_signal_emit (self, signals[WINDOW_LIST_EMPTY_SIGNAL], 0); + if (modest_window_mgr_num_windows (self) == 0) + g_signal_emit (self, signals[WINDOW_LIST_EMPTY_SIGNAL], 0); no_propagate = TRUE; } @@ -933,7 +934,8 @@ modest_window_mgr_unregister_window (ModestWindowMgr *self, gtk_widget_destroy (win->data); /* If there are no more windows registered emit the signal */ - if (priv->window_list == NULL && priv->banner_counter == 0) + if (modest_window_mgr_num_windows (self) == 0) +/* if (priv->window_list == NULL && priv->banner_counter == 0) */ g_signal_emit (self, signals[WINDOW_LIST_EMPTY_SIGNAL], 0); } @@ -1306,6 +1308,10 @@ modest_window_mgr_num_windows (ModestWindowMgr *self) if (priv->window_list) num_windows = g_list_length (priv->window_list); + /* Do not take into account the main window if it was hidden */ + if (priv->main_window && !GTK_WIDGET_VISIBLE (priv->main_window)) + num_windows--; + return num_windows + priv->banner_counter; } @@ -1372,8 +1378,7 @@ modest_window_mgr_unregister_banner (ModestWindowMgr *self) priv = MODEST_WINDOW_MGR_GET_PRIVATE (self); priv->banner_counter--; - if (priv->window_list == NULL && priv->banner_counter == 0) { +/* if (priv->window_list == NULL && priv->banner_counter == 0) */ + if (modest_window_mgr_num_windows (self) == 0) g_signal_emit (self, signals[WINDOW_LIST_EMPTY_SIGNAL], 0); - } - }