diff --git a/README.md b/README.md index b262617..10c35cc 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ https://github.com/user-attachments/assets/014c893f-115c-4ae9-8342-f9ae3e9a0df0 - pcre2 ## Arch Linux - +The package is in the Arch User Repository and is availble for manual download [here](https://aur.archlinux.org/packages/mangowc-git) or through a AUR helper like yay: ```bash yay -S mangowc-git diff --git a/src/animation/tag.h b/src/animation/tag.h index 4110efb..8e65a93 100644 --- a/src/animation/tag.h +++ b/src/animation/tag.h @@ -9,19 +9,23 @@ void set_tagin_animation(Monitor *m, Client *c) { c->animainit_geom.x = tag_animation_direction == VERTICAL ? c->animation.current.x - : c->mon->m.x + c->mon->m.width; + : MAX(c->mon->m.x + c->mon->m.width, + c->geom.x + c->mon->m.width); c->animainit_geom.y = tag_animation_direction == VERTICAL - ? c->mon->m.y + c->mon->m.height + ? MAX(c->mon->m.y + c->mon->m.height, + c->geom.y + c->mon->m.height) : c->animation.current.y; } else { - c->animainit_geom.x = tag_animation_direction == VERTICAL - ? c->animation.current.x - : m->m.x - c->geom.width; - c->animainit_geom.y = tag_animation_direction == VERTICAL - ? m->m.y - c->geom.height - : c->animation.current.y; + c->animainit_geom.x = + tag_animation_direction == VERTICAL + ? c->animation.current.x + : MIN(m->m.x - c->geom.width, c->geom.x - c->mon->m.width); + c->animainit_geom.y = + tag_animation_direction == VERTICAL + ? MIN(m->m.y - c->geom.height, c->geom.y - c->mon->m.height) + : c->animation.current.y; } } @@ -52,11 +56,13 @@ void set_arrange_visible(Monitor *m, Client *c, bool want_animation) { void set_tagout_animation(Monitor *m, Client *c) { if (m->pertag->curtag > m->pertag->prevtag) { c->pending = c->geom; - c->pending.x = tag_animation_direction == VERTICAL - ? c->animation.current.x - : c->mon->m.x - c->geom.width; + c->pending.x = + tag_animation_direction == VERTICAL + ? c->animation.current.x + : MIN(c->mon->m.x - c->geom.width, c->geom.x - c->mon->m.width); c->pending.y = tag_animation_direction == VERTICAL - ? c->mon->m.y - c->geom.height + ? MIN(c->mon->m.y - c->geom.height, + c->geom.y - c->mon->m.height) : c->animation.current.y; resize(c, c->geom, 0); @@ -64,9 +70,11 @@ void set_tagout_animation(Monitor *m, Client *c) { c->pending = c->geom; c->pending.x = tag_animation_direction == VERTICAL ? c->animation.current.x - : c->mon->m.x + c->mon->m.width; + : MAX(c->mon->m.x + c->mon->m.width, + c->geom.x + c->mon->m.width); c->pending.y = tag_animation_direction == VERTICAL - ? c->mon->m.y + c->mon->m.height + ? MAX(c->mon->m.y + c->mon->m.height, + c->geom.y + c->mon->m.height) : c->animation.current.y; resize(c, c->geom, 0); } diff --git a/src/config/parse_config.h b/src/config/parse_config.h index d6260c9..e4f00b1 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -1412,14 +1412,6 @@ void parse_option(Config *config, char *key, char *value) { } else { convert_hex_to_rgba(config->overlaycolor, color); } - } else if (strcmp(key, "autostart") == 0) { - if (sscanf(value, "%[^,],%[^,],%[^,]", config->autostart[0], - config->autostart[1], config->autostart[2]) != 3) { - fprintf(stderr, "Error: Invalid autostart format: %s\n", value); - } - trim_whitespace(config->autostart[0]); - trim_whitespace(config->autostart[1]); - trim_whitespace(config->autostart[2]); } else if (strcmp(key, "tagrule") == 0) { config->tag_rules = realloc(config->tag_rules, @@ -1654,7 +1646,7 @@ void parse_option(Config *config, char *key, char *value) { rule->isfullscreen = atoi(val); } else if (strcmp(key, "globalkeybinding") == 0) { char mod_str[256], keysym_str[256]; - sscanf(val, "%[^-]-%[a-zA-Z]", mod_str, keysym_str); + sscanf(val, "%255[^-]-%255[a-zA-Z]", mod_str, keysym_str); trim_whitespace(mod_str); trim_whitespace(keysym_str); rule->globalkeybinding.mod = parse_mod(mod_str); @@ -1736,7 +1728,7 @@ void parse_option(Config *config, char *key, char *value) { } else if (strncmp(key, "env", 3) == 0) { char env_type[256], env_value[256]; - if (sscanf(value, "%[^,],%[^\n]", env_type, env_value) < 2) { + if (sscanf(value, "%255[^,],%255[^\n]", env_type, env_value) < 2) { fprintf(stderr, "Error: Invalid bind format: %s\n", value); return; } @@ -1812,7 +1804,9 @@ void parse_option(Config *config, char *key, char *value) { arg_value[256] = "0\0", arg_value2[256] = "0\0", arg_value3[256] = "0\0", arg_value4[256] = "0\0", arg_value5[256] = "0\0"; - if (sscanf(value, "%[^,],%[^,],%[^,],%[^,],%[^,],%[^,],%[^,],%[^\n]", + if (sscanf(value, + "%255[^,],%255[^,],%255[^,],%255[^,],%255[^,],%255[^,],%255[" + "^,],%255[^\n]", mod_str, keysym_str, func_name, arg_value, arg_value2, arg_value3, arg_value4, arg_value5) < 3) { fprintf(stderr, "Error: Invalid bind format: %s\n", value); @@ -1883,7 +1877,9 @@ void parse_option(Config *config, char *key, char *value) { arg_value[256] = "0\0", arg_value2[256] = "0\0", arg_value3[256] = "0\0", arg_value4[256] = "0\0", arg_value5[256] = "0\0"; - if (sscanf(value, "%[^,],%[^,],%[^,],%[^,],%[^,],%[^,],%[^,],%[^\n]", + if (sscanf(value, + "%255[^,],%255[^,],%255[^,],%255[^,],%255[^,],%255[^,],%255[" + "^,],%255[^\n]", mod_str, button_str, func_name, arg_value, arg_value2, arg_value3, arg_value4, arg_value5) < 3) { fprintf(stderr, "Error: Invalid mousebind format: %s\n", value); @@ -1942,7 +1938,9 @@ void parse_option(Config *config, char *key, char *value) { arg_value[256] = "0\0", arg_value2[256] = "0\0", arg_value3[256] = "0\0", arg_value4[256] = "0\0", arg_value5[256] = "0\0"; - if (sscanf(value, "%[^,],%[^,],%[^,],%[^,],%[^,],%[^,],%[^,],%[^\n]", + if (sscanf(value, + "%255[^,],%255[^,],%255[^,],%255[^,],%255[^,],%255[^,],%255[" + "^,],%255[^\n]", mod_str, dir_str, func_name, arg_value, arg_value2, arg_value3, arg_value4, arg_value5) < 3) { fprintf(stderr, "Error: Invalid axisbind format: %s\n", value); @@ -2004,7 +2002,9 @@ void parse_option(Config *config, char *key, char *value) { arg_value[256] = "0\0", arg_value2[256] = "0\0", arg_value3[256] = "0\0", arg_value4[256] = "0\0", arg_value5[256] = "0\0"; - if (sscanf(value, "%[^,],%[^,],%[^,],%[^,],%[^,],%[^,],%[^\n]", + if (sscanf(value, + "%255[^,],%255[^,],%255[^,],%255[^,],%255[^,],%255[^,],%255[" + "^\n]", fold_str, func_name, arg_value, arg_value2, arg_value3, arg_value4, arg_value5) < 3) { fprintf(stderr, "Error: Invalid switchbind format: %s\n", value); @@ -2061,7 +2061,8 @@ void parse_option(Config *config, char *key, char *value) { arg_value3[256] = "0\0", arg_value4[256] = "0\0", arg_value5[256] = "0\0"; if (sscanf(value, - "%[^,],%[^,],%[^,],%[^,],%[^,],%[^,],%[^,],%[^,],%[^\n]", + "%255[^,],%255[^,],%255[^,],%255[^,],%255[^,],%255[^,],%255[" + "^,],%255[^,],%255[^\n]", mod_str, motion_str, fingers_count_str, func_name, arg_value, arg_value2, arg_value3, arg_value4, arg_value5) < 4) { fprintf(stderr, "Error: Invalid gesturebind format: %s\n", value); @@ -2116,7 +2117,7 @@ void parse_option(Config *config, char *key, char *value) { void parse_config_line(Config *config, const char *line) { char key[256], value[256]; - if (sscanf(line, "%[^=]=%[^\n]", key, value) != 2) { + if (sscanf(line, "%255[^=]=%255[^\n]", key, value) != 2) { // fprintf(stderr, "Error: Invalid line format: %s\n", line); return; } diff --git a/src/dispatch/bind_define.h b/src/dispatch/bind_define.h index eceec3a..93de6d7 100644 --- a/src/dispatch/bind_define.h +++ b/src/dispatch/bind_define.h @@ -190,7 +190,9 @@ int focusmon(const Arg *arg) { old_selmon_sel = selmon->sel; selmon = m; - warp_cursor_to_selmon(selmon); + if (warpcursor) { + warp_cursor_to_selmon(selmon); + } c = focustop(selmon); if (!c) { selmon->sel = NULL; @@ -293,6 +295,7 @@ int increase_proportion(const Arg *arg) { int setmfact(const Arg *arg) { float f; + Client *c = NULL; if (!arg || !selmon || !selmon->pertag->ltidxs[selmon->pertag->curtag]->arrange) @@ -301,8 +304,13 @@ int setmfact(const Arg *arg) { : arg->f - 1.0; if (f < 0.1 || f > 0.9) return 0; - // selmon->mfact = f; + selmon->pertag->mfacts[selmon->pertag->curtag] = f; + wl_list_for_each(c, &clients, link) { + if (VISIBLEON(c, selmon) && ISTILED(c)) { + c->master_mfact_per = f; + } + } arrange(selmon, false); return 0; } @@ -1071,7 +1079,9 @@ int tagmon(const Arg *arg) { focusclient(c, 1); arrange(selmon, false); } - warp_cursor_to_selmon(c->mon); + if (warpcursor) { + warp_cursor_to_selmon(c->mon); + } return 0; } @@ -1528,4 +1538,4 @@ int toggleoverview(const Arg *arg) { refresh_monitors_workspaces_status(selmon); return 0; -} \ No newline at end of file +} diff --git a/src/ext-protocol/foreign-toplevel.h b/src/ext-protocol/foreign-toplevel.h index fb44135..adfcd21 100644 --- a/src/ext-protocol/foreign-toplevel.h +++ b/src/ext-protocol/foreign-toplevel.h @@ -25,7 +25,7 @@ void handle_foreign_activate_request(struct wl_listener *listener, void *data) { } target = get_tags_first_tag(c->tags); - view(&(Arg){.ui = target}, true); + view_in_mon(&(Arg){.ui = target}, true, c->mon, true); focusclient(c, 1); wlr_foreign_toplevel_handle_v1_set_activated(c->foreign_toplevel, true); } diff --git a/src/layout/arrange.h b/src/layout/arrange.h index 0a4eca2..18d6b15 100644 --- a/src/layout/arrange.h +++ b/src/layout/arrange.h @@ -12,7 +12,7 @@ void set_size_per(Monitor *m, Client *c) { } if (!found) { - c->master_mfact_per = default_mfact; + c->master_mfact_per = m->pertag->mfacts[m->pertag->curtag]; c->master_inner_per = 1.0f; c->stack_innder_per = 1.0f; } diff --git a/src/mango.c b/src/mango.c index 218e502..c9f4bd0 100644 --- a/src/mango.c +++ b/src/mango.c @@ -5395,7 +5395,7 @@ urgent(struct wl_listener *listener, void *data) { if (focus_on_activate && !c->istagsilent && c != selmon->sel) { if (!(c->mon == selmon && c->tags & c->mon->tagset[c->mon->seltags])) - view(&(Arg){.ui = c->tags}, true); + view_in_mon(&(Arg){.ui = c->tags}, true, c->mon, true); focusclient(c, 1); } else if (c != focustop(selmon)) { if (client_surface(c)->mapped) @@ -5542,7 +5542,7 @@ void activatex11(struct wl_listener *listener, void *data) { if (focus_on_activate && !c->istagsilent && c != selmon->sel) { if (!(c->mon == selmon && c->tags & c->mon->tagset[c->mon->seltags])) - view(&(Arg){.ui = c->tags}, true); + view_in_mon(&(Arg){.ui = c->tags}, true, c->mon, true); wlr_xwayland_surface_activate(c->surface.xwayland, 1); focusclient(c, 1); need_arrange = true;