From 987ac20e1f63440d62c9f8299a8a2b6de201e71b Mon Sep 17 00:00:00 2001 From: Yuanle Song Date: Mon, 8 Apr 2019 11:13:07 +0800 Subject: [PATCH] minor update and add doc on on_name_lost() --- main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index a4bd63f..a1be78d 100644 --- a/main.c +++ b/main.c @@ -154,7 +154,14 @@ on_name_lost (GDBusConnection *connection, const gchar *name, gpointer user_data) { - g_message ("on_name_lost() name=%s", name); + AppData *appdata = (AppData*) user_data; + /* this won't happen if this is the only app that tries to take the + * name, because GApplication already have primary instance + * concept. None primary instance will just send 'activate' signal to + * primary instance and exit. They will not try to register ibus at + * all. */ + g_message ("on_name_lost() name=%s exiting", name); + g_application_quit (G_APPLICATION (appdata->app)); } static void -- GitLab