From 553cf8c4a065086212d22d52715333ee166b85b5 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 4 Jul 2005 12:22:41 +0000 Subject: Better fix for bug #151037 to make session shutdown work again. Also fix 2005-07-04 Christian Persch * embed/downloader-view.c: (remove_download), (prepare_close_cb), (downloader_view_init), (downloader_view_finalize), (downloader_view_remove_download), (download_dialog_delete_cb): * embed/ephy-embed-shell.c: (ephy_embed_shell_prepare_close), (ephy_embed_shell_class_init): * embed/ephy-embed-shell.h: * embed/ephy-favicon-cache.c: (prepare_close_cb), (ephy_favicon_cache_init), (kill_download): * embed/mozilla/mozilla-embed-find.cpp: * embed/mozilla/mozilla-embed-single.cpp: * embed/mozilla/mozilla-embed.cpp: * embed/mozilla/mozilla-notifiers.cpp: * embed/mozilla/mozilla-notifiers.h: * src/ephy-session.c: (ephy_session_init), (ephy_session_dispose), (ephy_session_autoresume), (close_dialog), (ephy_session_close): * src/ephy-shell.c: (ephy_shell_startup), (toolwindow_hide_cb): * src/ephy-window.c: (ephy_window_finalize): Better fix for bug #151037 to make session shutdown work again. Also fix session shutdown while resuming, and preserve the session in this case. --- embed/ephy-embed-shell.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'embed/ephy-embed-shell.c') diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c index 8067bf0ea..600037c93 100644 --- a/embed/ephy-embed-shell.c +++ b/embed/ephy-embed-shell.c @@ -43,6 +43,14 @@ struct _EphyEmbedShellPrivate EphyEncodings *encodings; }; +enum +{ + PREPARE_CLOSE, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + static void ephy_embed_shell_class_init (EphyEmbedShellClass *klass); static void ephy_embed_shell_init (EphyEmbedShell *shell); @@ -204,6 +212,14 @@ ephy_embed_shell_get_encodings (EphyEmbedShell *shell) return G_OBJECT (shell->priv->encodings); } +void +ephy_embed_shell_prepare_close (EphyEmbedShell *shell) +{ + EphyEmbedShellPrivate *priv = shell->priv; + + g_signal_emit (shell, signals[PREPARE_CLOSE], 0); +} + static void ephy_embed_shell_init (EphyEmbedShell *shell) { @@ -225,5 +241,22 @@ ephy_embed_shell_class_init (EphyEmbedShellClass *klass) klass->get_embed_single = impl_get_embed_single; +/** + * EphyEmbed::prepare-close: + * @shell: + * + * The ::prepare-close signal is emitted when epiphany is preparing to + * quit on command from the session manager. You can use it when you need + * to do something special (shut down a service, for example). + **/ + signals[PREPARE_CLOSE] = + g_signal_new ("prepare-close", + EPHY_TYPE_EMBED_SHELL, + G_SIGNAL_RUN_FIRST | G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EphyEmbedShellClass, prepare_close), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + g_type_class_add_private (object_class, sizeof (EphyEmbedShellPrivate)); } -- cgit v1.2.3