diff options
author | portix <none@none> | 2012-06-04 15:43:36 +0200 |
---|---|---|
committer | portix <none@none> | 2012-06-04 15:43:36 +0200 |
commit | c0ab8e97774dfe20cfee4e0f607e30170522e4f1 (patch) | |
tree | 5cbad9193d1a875b3da8a1a667326e4e39b7a17f /src | |
parent | 1e941e5a993d7f5b33a52a320db8861e746bde97 (diff) | |
download | dwb-c0ab8e97774dfe20cfee4e0f607e30170522e4f1.zip |
Use fallback mode for single-instance if getting a GDBusConnection fails.
Diffstat (limited to 'src')
-rw-r--r-- | src/application.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/application.c b/src/application.c index 1010d65b..f414b4b1 100644 --- a/src/application.c +++ b/src/application.c @@ -175,7 +175,9 @@ dwb_application_local_command_line(GApplication *app, gchar ***argv, gint *exit_ if (opt_single || !single_instance) { g_application_set_flags(app, G_APPLICATION_NON_UNIQUE); } - if (g_application_register(app, NULL, &error)) { + GDBusConnection *bus = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, NULL); + if (bus != NULL && g_application_register(app, NULL, &error)) { + g_object_unref(bus); remote = g_application_get_is_remote(app); if (remote) { /* Restore executable args */ |