[PATCH 3/6] Disable sfdump if there is no xrandr support.
Mathieu OTHACEHE <[email protected]> Fri, 25 Nov 2016 15:35:20 +0100
| Newsgroups | gmane.comp.window-managers.ratpoison.devel |
|---|---|
| Message-ID | <[email protected]> |
Without xrandr support, sfdump command has no interest.
---
src/actions.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/actions.c b/src/actions.c
index 77d5cee..faddbd1 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -5599,12 +5599,17 @@ cmd_set (int interactive UNUSED, struct cmdarg **args)
cmdret *
cmd_sfdump (int interactively UNUSED, struct cmdarg **args UNUSED)
{
+#ifdef HAVE_XRANDR
char screen_suffix[16];
cmdret *ret;
struct sbuf *dump;
rp_frame *cur_frame;
rp_screen *cur_screen;
+ if (!rp_have_xrandr) {
+ return cmdret_new (RET_FAILURE, "sfdump: no xrandr support");
+ }
+
dump = sbuf_new (0);
list_for_each_entry (cur_screen, &rp_screens, node)
@@ -5629,6 +5634,9 @@ cmd_sfdump (int interactively UNUSED, struct cmdarg **args UNUSED)
ret = cmdret_new (RET_SUCCESS, "%s", sbuf_get (dump));
sbuf_free (dump);
return ret;
+#else
+ return cmdret_new (RET_FAILURE, "sfdump: no xrandr support");
+#endif
}
cmdret *
--
2.10.0