Created attachment 9360 Fix inhibitor listing in xfce4-screensaver-command When adding an inhibitor using e.g. xfce4-screensaver-command -i, xfce4-screensaver-command -q still says that the screensaver is uninhibited: [m@n:~] xfce4-screensaver-command -i & [1] 469425 [m@n:~] xfce4-screensaver-command -q The screensaver is inactive The screensaver is not inhibited The screensaver debug log shows inhibitor addition though: [listener_add_ref_entry] gs-listener-dbus.c:566 (22:56:08.172): Adding inhibitor from Unknown for reason 'Unknown' on connection :1.168 It seems, the code for unpacking the dbus query in the command source: body = g_dbus_message_get_body (reply); g_object_unref (reply); if (g_variant_n_children(body) <= 0) { g_print (_("The screensaver is not inhibited\n")); } else { g_variant_get (body, "s", &iter); g_print (_("The screensaver is being inhibited by:\n")); while (g_variant_iter_loop (iter, "s", &str)) { g_print ("\t%s\n", str); } g_variant_iter_free (iter); } is wrong int two respects: - unref'ing the reply gobject also invalidates the body extracted from it and - the iterator is set up with the wrong format string See attached patch for a fix that works for me. With that patch, the command correctly reports active inhibitors: [m@n:~/src/xfce4-screensaver] src/xfce4-screensaver-command -i & [1] 470027 [m@n:~/src/xfce4-screensaver] src/xfce4-screensaver-command -q The screensaver is inactive The screensaver is being inhibited by: Application="Unknown"; Since="2020-01-08T21:56:08.172222Z"; Reason="Unknown";
Created attachment 9364 Fix inhibitor listing in xfce4-screensaver-command Updated patch that correctly shows uninhibited status as well.
Michael Weiser referenced this bugreport in commit 2568143245ae451776c015df53b0fe46df7af74b Fix inhibitor listing in xfce4-screensaver-command (bug #16355) https://git.xfce.org/apps/xfce4-screensaver/commit?id=2568143245ae451776c015df53b0fe46df7af74b
Thanks for the patch! Applied above.