From 334b42bda165b9cfd18f60f60742f850f9154c2e Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Thu, 14 Nov 2002 23:08:29 +0000 Subject: Use bonobo_main_quit() instead of gtk_main_quit(). (shell_weak_notify): * main.c (no_views_left_cb): Use bonobo_main_quit() instead of gtk_main_quit(). (shell_weak_notify): Likewise. (idle_cb): Likewise. * e-shell.c (notify_no_views_left_idle_cb): New idle function to emit the "no_views_left" signal. (view_weak_notify): Put it on the idle loop instead of firing the signal here. * e-task-widget.c (e_task_widget_construct): Ref/sink the GtkTooltips object. svn path=/trunk/; revision=18763 --- shell/e-shell.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'shell/e-shell.c') diff --git a/shell/e-shell.c b/shell/e-shell.c index 4acc386ae0..a02cc1e89b 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -956,6 +956,24 @@ view_delete_event_cb (GtkWidget *widget, return ! e_shell_request_close_view (shell, E_SHELL_VIEW (widget)); } +static gboolean +notify_no_views_left_idle_cb (void *data) +{ + EShell *shell; + + puts (__FUNCTION__); + + shell = E_SHELL (data); + + set_interactive (shell, FALSE); + + bonobo_object_ref (BONOBO_OBJECT (shell)); + g_signal_emit (shell, signals [NO_VIEWS_LEFT], 0); + bonobo_object_unref (BONOBO_OBJECT (shell)); + + return FALSE; +} + static void view_weak_notify (void *data, GObject *where_the_object_was) @@ -975,13 +993,8 @@ view_weak_notify (void *data, shell->priv->views = g_list_remove (shell->priv->views, where_the_object_was); - if (shell->priv->views == NULL) { - set_interactive (shell, FALSE); - - bonobo_object_ref (BONOBO_OBJECT (shell)); - g_signal_emit (shell, signals [NO_VIEWS_LEFT], 0); - bonobo_object_unref (BONOBO_OBJECT (shell)); - } + if (shell->priv->views == NULL) + g_idle_add (notify_no_views_left_idle_cb, shell); } static EShellView * -- cgit v1.2.3