aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-10-25 23:03:28 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-10-26 17:21:59 +0800
commitbec05425315c6ab2581300b9f0f98f8fe2e2273d (patch)
tree1a1f3d844bb8dfecb172797c963a29122f03fa19
parent886d9c9f70c77c1bb1d595595f8b7cf75ea4ebc4 (diff)
downloadgsoc2013-empathy-bec05425315c6ab2581300b9f0f98f8fe2e2273d.tar
gsoc2013-empathy-bec05425315c6ab2581300b9f0f98f8fe2e2273d.tar.gz
gsoc2013-empathy-bec05425315c6ab2581300b9f0f98f8fe2e2273d.tar.bz2
gsoc2013-empathy-bec05425315c6ab2581300b9f0f98f8fe2e2273d.tar.lz
gsoc2013-empathy-bec05425315c6ab2581300b9f0f98f8fe2e2273d.tar.xz
gsoc2013-empathy-bec05425315c6ab2581300b9f0f98f8fe2e2273d.tar.zst
gsoc2013-empathy-bec05425315c6ab2581300b9f0f98f8fe2e2273d.zip
empathy: rely on gtk_application_add_window() to manage the main loop
We are not supposed to call gtk_main_quit() as we don't use gtk_main() any more. Instead we add the windows to the GtkApplication which will take care of exiting when they have been all destroyed. https://bugzilla.gnome.org/show_bug.cgi?id=662504
-rw-r--r--src/empathy-main-window.c2
-rw-r--r--src/empathy-status-icon.c4
-rw-r--r--src/empathy.c7
3 files changed, 7 insertions, 6 deletions
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index f3722524b..77070a89b 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -1273,7 +1273,7 @@ static void
main_window_chat_quit_cb (GtkAction *action,
EmpathyMainWindow *window)
{
- gtk_main_quit ();
+ gtk_widget_destroy (GTK_WIDGET (window));
}
static void
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index d6f5b2e46..3aa27a467 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -320,7 +320,9 @@ static void
status_icon_quit_cb (GtkAction *action,
EmpathyStatusIcon *icon)
{
- gtk_main_quit ();
+ EmpathyStatusIconPriv *priv = GET_PRIV (icon);
+
+ gtk_widget_destroy (priv->window);
}
static void
diff --git a/src/empathy.c b/src/empathy.c
index e95ad1d20..505949d9c 100644
--- a/src/empathy.c
+++ b/src/empathy.c
@@ -181,9 +181,6 @@ empathy_app_finalize (GObject *object)
g_free (self->preferences_tab);
- if (self->window != NULL)
- gtk_widget_destroy (self->window);
-
if (finalize != NULL)
finalize (object);
}
@@ -348,12 +345,14 @@ empathy_app_command_line (GApplication *app,
g_error_free (error);
}
- g_application_hold (G_APPLICATION (app));
self->activated = TRUE;
/* Setting up UI */
self->window = empathy_main_window_dup ();
+ gtk_application_add_window (GTK_APPLICATION (app),
+ GTK_WINDOW (self->window));
+
/* check if Shell is running */
dbus = tp_dbus_daemon_dup (&error);
g_assert_no_error (error);