From 722a8f1c90415b7c82090212e10b1095e39b6c01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Thu, 15 Jan 2026 16:10:41 +0100 Subject: [PATCH] feedbackd: Allow replacement and an option for it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This brings us in line with e.g. the portals Signed-off-by: Guido Günther --- doc/feedbackd.rst | 3 +++ src/fbd.c | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/feedbackd.rst b/doc/feedbackd.rst index 8869a67..07586f8 100644 --- a/doc/feedbackd.rst +++ b/doc/feedbackd.rst @@ -41,6 +41,9 @@ Options ``-v``, ``--verbose`` print verbose information +``-r``, ``--replace`` + replace a running instance + Configuration ============= diff --git a/src/fbd.c b/src/fbd.c index 10fac2f..f7fee1f 100644 --- a/src/fbd.c +++ b/src/fbd.c @@ -116,13 +116,14 @@ int main (int argc, char *argv[]) { g_autoptr (GError) err = NULL; - gboolean opt_verbose = FALSE; + gboolean opt_verbose = FALSE, opt_replace = FALSE; g_autoptr (GOptionContext) opt_context = NULL; g_autoptr (FbdFeedbackManager) manager = NULL; const char *debugenv; GOptionEntry options[] = { { "verbose", 'v', 0, G_OPTION_ARG_NONE, &opt_verbose, - "Print debug information during command processing", NULL }, + "Print debug information during command processing", NULL }, + { "replace", 'r', 0, G_OPTION_ARG_NONE, &opt_replace, "Replace a running instance", NULL }, { NULL } }; @@ -153,7 +154,8 @@ main (int argc, char *argv[]) g_bus_own_name (FB_DBUS_TYPE, FB_DBUS_NAME, - G_BUS_NAME_OWNER_FLAGS_NONE, + G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT | + (opt_replace ? G_BUS_NAME_OWNER_FLAGS_REPLACE : 0), bus_acquired_cb, name_acquired_cb, name_lost_cb,