diff --git a/src/config/parse_config.h b/src/config/parse_config.h index 2a3330b7..dd88230c 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -1577,6 +1577,7 @@ bool parse_option(Config *config, char *key, char *value) { config->default_nmaster = atoi(value); } else if (strcmp(key, "tag_count") == 0) { config->tag_count = CLAMP_INT(atoi(value), 1, 32); + tag_count = config->tag_count; } else if (strcmp(key, "center_master_overspread") == 0) { config->center_master_overspread = atoi(value); } else if (strcmp(key, "center_when_single_stack") == 0) { @@ -3494,6 +3495,7 @@ bool parse_config(void) { config.scroller_proportion_preset_count = 0; config.circle_layout = NULL; config.circle_layout_count = 0; + config.tag_count = 9; config.tag_rules = NULL; config.tag_rules_count = 0; config.cursor_theme = NULL; diff --git a/src/ext-protocol/ext-workspace.h b/src/ext-protocol/ext-workspace.h index fa07b1ca..61bf2ac2 100644 --- a/src/ext-protocol/ext-workspace.h +++ b/src/ext-protocol/ext-workspace.h @@ -74,7 +74,7 @@ static const char *get_name_from_tag(uint32_t tag, char *buf, size_t len) { return "overview"; if (tag > (uint32_t)tag_count) return NULL; - snprintf(buf, len, "%u", tag); + snprintf(buf, len, "%u", CLAMP_INT(tag, 1, 32)); return buf; } @@ -188,4 +188,4 @@ void workspaces_init() { ext_manager = wlr_ext_workspace_manager_v1_create(dpy, 1); /* Initialize the global workspaces list */ wl_list_init(&workspaces); -} \ No newline at end of file +} diff --git a/src/mango.c b/src/mango.c index 3e0ea8f6..c06a4116 100644 --- a/src/mango.c +++ b/src/mango.c @@ -5456,7 +5456,6 @@ void setup(void) { setenv("XDG_CURRENT_DESKTOP", "mango", 1); parse_config(); - tag_count = config.tag_count; init_baked_points(); int32_t drm_fd, i, sig[] = {SIGCHLD, SIGINT, SIGTERM, SIGPIPE};