From aad3ac6ddd62d5cd1b3421f5bf45ccdcf1b0ed35 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Thu, 16 May 2002 14:54:55 +0000 Subject: Ask e_shell_prepare_for_quit() before destroying the view if it's the last * e-shell.c (view_delete_event_cb): Ask e_shell_prepare_for_quit() before destroying the view if it's the last one. * e-shell-view-menu.c (command_close): Synthesize a delete_event on the view instead of directly destroying it. svn path=/trunk/; revision=16931 --- shell/e-shell-view-menu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'shell/e-shell-view-menu.c') diff --git a/shell/e-shell-view-menu.c b/shell/e-shell-view-menu.c index efbb5898a5..52261abc1f 100644 --- a/shell/e-shell-view-menu.c +++ b/shell/e-shell-view-menu.c @@ -130,10 +130,17 @@ command_close (BonoboUIComponent *uih, const char *path) { EShellView *shell_view; + GdkEvent delete_event; shell_view = E_SHELL_VIEW (data); - gtk_object_destroy (GTK_OBJECT (shell_view)); + /* Send a delete_event to the window. This way we make sure that the + behaviors for delete_event and the menu item are the same. */ + + delete_event.any.type = GDK_DELETE; + delete_event.any.window = GTK_WIDGET (shell_view)->window; + delete_event.any.send_event = 0; + gtk_widget_event (GTK_WIDGET (shell_view), &delete_event); } static void -- cgit v1.2.3