aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTravis Reitter <travis.reitter@collabora.co.uk>2010-10-23 03:16:18 +0800
committerTravis Reitter <travis.reitter@collabora.co.uk>2010-10-30 00:35:09 +0800
commitf9e4c3d37f6cc259beca5b4dde709a34e517d2c6 (patch)
tree22546dff2b95418d4c66314f83f27b877fcbc08c /src
parent0ff09c9c9bf89948a8e37b3c3606fc42f0d8e618 (diff)
downloadgsoc2013-empathy-f9e4c3d37f6cc259beca5b4dde709a34e517d2c6.tar
gsoc2013-empathy-f9e4c3d37f6cc259beca5b4dde709a34e517d2c6.tar.gz
gsoc2013-empathy-f9e4c3d37f6cc259beca5b4dde709a34e517d2c6.tar.bz2
gsoc2013-empathy-f9e4c3d37f6cc259beca5b4dde709a34e517d2c6.tar.lz
gsoc2013-empathy-f9e4c3d37f6cc259beca5b4dde709a34e517d2c6.tar.xz
gsoc2013-empathy-f9e4c3d37f6cc259beca5b4dde709a34e517d2c6.tar.zst
gsoc2013-empathy-f9e4c3d37f6cc259beca5b4dde709a34e517d2c6.zip
Properly handle remote instances of the debugger.
Helps bgo#632912.
Diffstat (limited to 'src')
-rw-r--r--src/empathy-debugger.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/empathy-debugger.c b/src/empathy-debugger.c
index 2688bfd1e..a7ebdf117 100644
--- a/src/empathy-debugger.c
+++ b/src/empathy-debugger.c
@@ -29,29 +29,43 @@
#define EMPATHY_DEBUGGER_DBUS_NAME "org.gnome.Empathy.Debugger"
+static GtkWidget *window = NULL;
+
+static void
+activate_cb (GApplication *app)
+{
+ if (window == NULL)
+ {
+ window = empathy_debug_window_new (NULL);
+ g_signal_connect (window, "destroy", gtk_main_quit, NULL);
+
+ /* don't let this application exit automatically */
+ g_application_hold (G_APPLICATION (app));
+ }
+ else
+ {
+ gtk_window_present (GTK_WINDOW (window));
+ }
+}
+
int
main (int argc,
char **argv)
{
- GtkWidget *window;
GtkApplication *app;
g_thread_init (NULL);
empathy_gtk_init ();
app = gtk_application_new (EMPATHY_DEBUGGER_DBUS_NAME,
- G_APPLICATION_IS_SERVICE);
+ G_APPLICATION_FLAGS_NONE);
+ g_signal_connect (app, "activate", G_CALLBACK (activate_cb), NULL);
g_set_application_name (_("Empathy Debugger"));
gtk_window_set_default_icon_name ("empathy");
textdomain (GETTEXT_PACKAGE);
- window = empathy_debug_window_new (NULL);
- g_signal_connect (window, "destroy", gtk_main_quit, NULL);
-
- /* don't let this application exit automatically */
- g_application_hold (G_APPLICATION (app));
g_application_run (G_APPLICATION (app), argc, argv);
g_object_unref (app);