]> git.lizzy.rs Git - bspwm.git/commitdiff
Reinstate getters for default border width and window gap
authorBastien Dejean <nihilhill@gmail.com>
Wed, 7 May 2014 09:09:48 +0000 (11:09 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Wed, 7 May 2014 09:09:48 +0000 (11:09 +0200)
doc/bspwm.1.txt
messages.c

index b91839882341eb31c6d40bf475fc1184096e25f7..835873dc284d739432f325ff9d1a5f39fe6c9a0a 100644 (file)
@@ -694,14 +694,14 @@ Monitor and Desktop Settings
 'left_padding'::
        Padding space added at the sides of the monitor or desktop.
 
-Global, Desktop and Window Settings
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Default, Desktop and Window Settings
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 'border_width'::
        Window border width.
 
-Global and Desktop Settings
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Default and Desktop Settings
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 'window_gap'::
        Size of the gap that separates windows.
index da669c405d62c826afe1c0c0f0722185e4eafc09..778cd5a72f291ac0967eea170c62d5a062750fe9 100644 (file)
@@ -868,7 +868,7 @@ int cmd_quit(char **args, int num)
 
 int set_setting(coordinates_t loc, char *name, char *value)
 {
-#define DESKWINGLOBSET(k, v) \
+#define DESKWINDEFSET(k, v) \
                if (loc.node != NULL) \
                        loc.node->client->k = v; \
                else if (loc.desktop != NULL) \
@@ -882,9 +882,9 @@ int set_setting(coordinates_t loc, char *name, char *value)
                unsigned int bw;
                if (sscanf(value, "%u", &bw) != 1)
                        return MSG_FAILURE;
-               DESKWINGLOBSET(border_width, bw)
-#undef DESKWINGLOBSET
-#define DESKGLOBSET(k, v) \
+               DESKWINDEFSET(border_width, bw)
+#undef DESKWINDEFSET
+#define DESKDEFSET(k, v) \
                if (loc.desktop != NULL) \
                        loc.desktop->k = v; \
                else if (loc.monitor != NULL) \
@@ -896,8 +896,8 @@ int set_setting(coordinates_t loc, char *name, char *value)
                int wg;
                if (sscanf(value, "%i", &wg) != 1)
                        return MSG_FAILURE;
-               DESKGLOBSET(window_gap, wg)
-#undef DESKGLOBSET
+               DESKDEFSET(window_gap, wg)
+#undef DESKDEFSET
 #define MONDESKSET(k, v) \
                if (loc.desktop != NULL) \
                        loc.desktop->k = v; \
@@ -1013,17 +1013,17 @@ int get_setting(coordinates_t loc, char *name, FILE* rsp)
        if (streq("split_ratio", name))
                fprintf(rsp, "%lf", split_ratio);
        else if (streq("window_gap", name))
-               if (loc.desktop == NULL)
-                       return MSG_FAILURE;
-               else
+               if (loc.desktop != NULL)
                        fprintf(rsp, "%i", loc.desktop->window_gap);
+               else
+                       fprintf(rsp, "%i", window_gap);
        else if (streq("border_width", name))
                if (loc.node != NULL)
                        fprintf(rsp, "%u", loc.node->client->border_width);
                else if (loc.desktop != NULL)
                        fprintf(rsp, "%u", loc.desktop->border_width);
                else
-                       return MSG_FAILURE;
+                       fprintf(rsp, "%u", border_width);
        else if (streq("external_rules_command", name))
                fprintf(rsp, "%s", external_rules_command);
        else if (streq("status_prefix", name))