aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xlopez@igalia.com>2011-06-30 02:19:40 +0800
committerXan Lopez <xlopez@igalia.com>2011-06-30 02:21:49 +0800
commiteddaae421e4e38d8124f659b1bd8ff65162247e4 (patch)
tree36284854d06f04d3c4609d00a2448c5c1ec8b65a
parent5b3154f5ddb95f162389340b178d6fc51b3a3bd7 (diff)
downloadgsoc2013-epiphany-eddaae421e4e38d8124f659b1bd8ff65162247e4.tar
gsoc2013-epiphany-eddaae421e4e38d8124f659b1bd8ff65162247e4.tar.gz
gsoc2013-epiphany-eddaae421e4e38d8124f659b1bd8ff65162247e4.tar.bz2
gsoc2013-epiphany-eddaae421e4e38d8124f659b1bd8ff65162247e4.tar.lz
gsoc2013-epiphany-eddaae421e4e38d8124f659b1bd8ff65162247e4.tar.xz
gsoc2013-epiphany-eddaae421e4e38d8124f659b1bd8ff65162247e4.tar.zst
gsoc2013-epiphany-eddaae421e4e38d8124f659b1bd8ff65162247e4.zip
Use GtkApplication's window tracking for EphyWindow too
Instead of our own home-grown system. I think we should subclass window_added in GtkApplication and do there the session & state stuff and get rid of ephy_session_add_window and ephy_state_add_window.
-rw-r--r--embed/ephy-embed-shell.c40
-rw-r--r--embed/ephy-embed-shell.h4
-rw-r--r--src/ephy-window.c2
3 files changed, 1 insertions, 45 deletions
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index aef7bb214..73ab92771 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -58,7 +58,6 @@ struct _EphyEmbedShellPrivate
EphyAdBlockManager *adblock_manager;
GtkPageSetup *page_setup;
GtkPrintSettings *print_settings;
- guint object_count;
gboolean private_instance;
guint single_initialised : 1;
};
@@ -68,7 +67,6 @@ enum
DOWNLOAD_ADDED,
DOWNLOAD_REMOVED,
PREPARE_CLOSE,
- QUIT,
LAST_SIGNAL
};
@@ -406,25 +404,6 @@ ephy_embed_shell_class_init (EphyEmbedShellClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
-/**
- * EphyEmbedShell::quit:
- * @shell: an #EphyEmbedShell
- *
- * The ::quit is emitted when all windows (browser windows, popups,
- * download windows, etc) are closed and the @shell is ready to be
- * closed.
- *
- * Since: 2.30
- **/
- signals[QUIT] =
- g_signal_new ("quit",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- 0,
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
g_type_class_add_private (object_class, sizeof (EphyEmbedShellPrivate));
}
@@ -666,25 +645,6 @@ ephy_embed_shell_remove_download (EphyEmbedShell *shell, EphyDownload *download)
g_signal_emit_by_name (shell, "download-removed", download, NULL);
}
-
-static void
-object_notify_cb (EphyEmbedShell *shell, GObject *object)
-{
- shell->priv->object_count--;
- if (shell->priv->object_count == 0)
- g_signal_emit (shell, signals[QUIT], 0);
-}
-
-void
-_ephy_embed_shell_track_object (EphyEmbedShell *shell, GObject *object)
-{
- g_return_if_fail (EPHY_IS_EMBED_SHELL (shell));
- g_return_if_fail (G_IS_OBJECT (object));
-
- g_object_weak_ref (object, (GWeakNotify)object_notify_cb, shell);
- shell->priv->object_count++;
-}
-
/**
* ephy_embed_shell_is_private_instance:
* @shell: an #EphyEmbedShell
diff --git a/embed/ephy-embed-shell.h b/embed/ephy-embed-shell.h
index c91dc9d80..02eaf43a8 100644
--- a/embed/ephy-embed-shell.h
+++ b/embed/ephy-embed-shell.h
@@ -103,10 +103,6 @@ void ephy_embed_shell_remove_download (EphyEmbedShell *shell,
gboolean ephy_embed_shell_is_private_instance (EphyEmbedShell *shell);
-/* Private API */
-void _ephy_embed_shell_track_object (EphyEmbedShell *shell,
- GObject *object);
-
G_END_DECLS
#endif /* !EPHY_EMBED_SHELL_H */
diff --git a/src/ephy-window.c b/src/ephy-window.c
index a10b81034..dcd0db7ed 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -3641,7 +3641,7 @@ ephy_window_init (EphyWindow *window)
{
LOG ("EphyWindow initialising %p", window);
- _ephy_embed_shell_track_object (EPHY_EMBED_SHELL (ephy_shell), G_OBJECT (window));
+ gtk_application_add_window (GTK_APPLICATION (ephy_shell), GTK_WINDOW (window));
window->priv = EPHY_WINDOW_GET_PRIVATE (window);