]> git.lizzy.rs Git - bspwm.git/blobdiff - src/messages.c
Properly handle sticky nodes in transfer_desktop
[bspwm.git] / src / messages.c
index dd5228923c0fe4a708b5deb7aa6876b280621883..7c3d4e39182fd6382ae4561a6a36598dbf669798 100644 (file)
@@ -27,6 +27,7 @@
 #include <string.h>
 #include <stdbool.h>
 #include <stdarg.h>
+#include <inttypes.h>
 #include <unistd.h>
 #include "bspwm.h"
 #include "desktop.h"
@@ -342,6 +343,8 @@ void cmd_node(char **args, int num, FILE *rsp)
                                set_private(trg.monitor, trg.desktop, trg.node, (a == ALTER_SET ? b : !trg.node->private));
                        } else if (streq("locked", key)) {
                                set_locked(trg.monitor, trg.desktop, trg.node, (a == ALTER_SET ? b : !trg.node->locked));
+                       } else if (streq("marked", key)) {
+                               set_marked(trg.monitor, trg.desktop, trg.node, (a == ALTER_SET ? b : !trg.node->marked));
                        } else {
                                fail(rsp, "node %s: Invalid key: '%s'.\n", *(args - 1), key);
                                break;
@@ -1512,6 +1515,22 @@ void set_setting(coordinates_t loc, char *name, char *value, FILE *rsp)
                }
                SET_DEF_MON_DESK(padding.left, lp)
 #undef SET_DEF_MON_DESK
+       } else if (streq("top_monocle_padding", name)) {
+               if (sscanf(value, "%i", &monocle_padding.top) != 1) {
+                       fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value);
+               }
+       } else if (streq("right_monocle_padding", name)) {
+               if (sscanf(value, "%i", &monocle_padding.right) != 1) {
+                       fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value);
+               }
+       } else if (streq("bottom_monocle_padding", name)) {
+               if (sscanf(value, "%i", &monocle_padding.bottom) != 1) {
+                       fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value);
+               }
+       } else if (streq("left_monocle_padding", name)) {
+               if (sscanf(value, "%i", &monocle_padding.left) != 1) {
+                       fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value);
+               }
 #define SET_STR(s) \
        } else if (streq(#s, name)) { \
                if (snprintf(s, sizeof(s), "%s", value) < 0) { \
@@ -1552,6 +1571,27 @@ void set_setting(coordinates_t loc, char *name, char *value, FILE *rsp)
                        fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value);
                        return;
                }
+       } else if (streq("automatic_scheme", name)) {
+               automatic_scheme_t a;
+               if (parse_automatic_scheme(value, &a)) {
+                       automatic_scheme = a;
+               } else {
+                       fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value);
+                       return;
+               }
+       } else if (streq("removal_adjustment", name)) {
+               removal_adjustment_t r;
+               if (parse_removal_adjustment(value, &r)) {
+                       removal_adjustment = r;
+               } else {
+                       fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value);
+                       return;
+               }
+       } else if (streq("mapping_events_count", name)) {
+               if (sscanf(value, "%" SCNi8, &mapping_events_count) != 1) {
+                       fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value);
+                       return;
+               }
        } else if (streq("directional_focus_tightness", name)) {
                tightness_t p;
                if (parse_tightness(value, &p)) {
@@ -1560,6 +1600,14 @@ void set_setting(coordinates_t loc, char *name, char *value, FILE *rsp)
                        fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value);
                        return;
                }
+       } else if (streq("ignore_ewmh_fullscreen", name)) {
+               state_transition_t m;
+               if (parse_state_transition(value, &m)) {
+                       ignore_ewmh_fullscreen = m;
+               } else {
+                       fail(rsp, "config: %s: Invalid value: '%s'.\n", name, value);
+                       return;
+               }
        } else if (streq("pointer_modifier", name)) {
                if (parse_modifier_mask(value, &pointer_modifier)) {
                        ungrab_buttons();
@@ -1628,7 +1676,6 @@ void set_setting(coordinates_t loc, char *name, char *value, FILE *rsp)
                }
                SET_BOOL(borderless_monocle)
                SET_BOOL(gapless_monocle)
-               SET_BOOL(paddingless_monocle)
                SET_BOOL(single_monocle)
                SET_BOOL(swallow_first_click)
                SET_BOOL(pointer_follows_focus)
@@ -1709,14 +1756,30 @@ void get_setting(coordinates_t loc, char *name, FILE* rsp)
        } else if (streq("left_padding", name)) {
                GET_DEF_MON_DESK(padding.left)
 #undef GET_DEF_MON_DESK
+       } else if (streq("top_monocle_padding", name)) {
+               fprintf(rsp, "%i", monocle_padding.top);
+       } else if (streq("right_monocle_padding", name)) {
+               fprintf(rsp, "%i", monocle_padding.right);
+       } else if (streq("bottom_monocle_padding", name)) {
+               fprintf(rsp, "%i", monocle_padding.bottom);
+       } else if (streq("left_monocle_padding", name)) {
+               fprintf(rsp, "%i", monocle_padding.left);
        } else if (streq("external_rules_command", name)) {
                fprintf(rsp, "%s", external_rules_command);
        } else if (streq("status_prefix", name)) {
                fprintf(rsp, "%s", status_prefix);
        } else if (streq("initial_polarity", name)) {
                fprintf(rsp, "%s", CHILD_POL_STR(initial_polarity));
+       } else if (streq("automatic_scheme", name)) {
+               fprintf(rsp, "%s", AUTO_SCM_STR(automatic_scheme));
+       } else if (streq("removal_adjustment", name)) {
+               fprintf(rsp, "%s", REM_ADJ_STR(removal_adjustment));
+       } else if (streq("mapping_events_count", name)) {
+               fprintf(rsp, "%" PRIi8, mapping_events_count);
        } else if (streq("directional_focus_tightness", name)) {
                fprintf(rsp, "%s", TIGHTNESS_STR(directional_focus_tightness));
+       } else if (streq("ignore_ewmh_fullscreen", name)) {
+               print_ignore_request(ignore_ewmh_fullscreen, rsp);
        } else if (streq("pointer_modifier", name)) {
                print_modifier_mask(pointer_modifier, rsp);
        } else if (streq("click_to_focus", name)) {
@@ -1741,7 +1804,6 @@ void get_setting(coordinates_t loc, char *name, FILE* rsp)
                fprintf(rsp, "%s", BOOL_STR(s));
        GET_BOOL(borderless_monocle)
        GET_BOOL(gapless_monocle)
-       GET_BOOL(paddingless_monocle)
        GET_BOOL(single_monocle)
        GET_BOOL(swallow_first_click)
        GET_BOOL(focus_follows_pointer)