]> git.lizzy.rs Git - bspwm.git/commitdiff
Catch descriptor-free incompatibilities in queries
authorBastien Dejean <nihilhill@gmail.com>
Sun, 26 Jul 2020 19:37:18 +0000 (21:37 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Sun, 26 Jul 2020 19:37:18 +0000 (21:37 +0200)
src/messages.c

index d843c85c54a0c02845d09b61fd8da13c3be84946..9d9f46786893e99aabecf528232d3f87571a692a 100644 (file)
@@ -1095,6 +1095,12 @@ void cmd_query(char **args, int num, FILE *rsp)
                goto end;
        }
 
+       if ((dom == DOMAIN_MONITOR && (desktop_sel != NULL || node_sel != NULL)) ||
+           (dom == DOMAIN_DESKTOP && node_sel != NULL)) {
+               fail(rsp, "query -%c: Incompatible descriptor-free constraints.\n", dom == DOMAIN_MONITOR ? 'M' : 'D');
+               goto end;
+       }
+
        if (dom == DOMAIN_NODE) {
                if (query_node_ids(&ref, &trg, monitor_sel, desktop_sel, node_sel, rsp) < 1) {
                        fail(rsp, "");