diff options
author | emersion <contact@emersion.fr> | 2018-10-20 08:35:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-20 08:35:20 +0200 |
commit | 4bde0eb911062817b9b41e91039b373b1efb0e0e (patch) | |
tree | a2664a38b2fa5da960f432debf65ce60c0d60eb6 /swaybar | |
parent | 5b8257b88f703f48466f3b917f1ceaee7c457355 (diff) | |
parent | 17fb3b6994a65a7286cd21f3c25294ce5c8cceed (diff) |
Merge pull request #2879 from Emantor/fix/swaybar_position
swaybar: disallow left and right position and print error on default
Diffstat (limited to 'swaybar')
-rw-r--r-- | swaybar/config.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/swaybar/config.c b/swaybar/config.c index eafb0b69..1293cdae 100644 --- a/swaybar/config.c +++ b/swaybar/config.c @@ -1,6 +1,7 @@ #define _XOPEN_SOURCE 500 #include <stdlib.h> #include <string.h> +#include <wlr/util/log.h> #include "swaybar/config.h" #include "wlr-layer-shell-unstable-v1-client-protocol.h" #include "stringop.h" @@ -9,17 +10,12 @@ uint32_t parse_position(const char *position) { uint32_t horiz = ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT; - uint32_t vert = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | - ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM; if (strcmp("top", position) == 0) { return ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | horiz; } else if (strcmp("bottom", position) == 0) { return ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM | horiz; - } else if (strcmp("left", position) == 0) { - return ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | vert; - } else if (strcmp("right", position) == 0) { - return ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT | vert; } else { + wlr_log(WLR_ERROR, "Invalid position: %s, defaulting to bottom", position); return ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM | horiz; } } |