diff --git a/README.md b/README.md index 843780ba..227f0d8c 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,12 @@ Finally, install the package: emerge --ask --verbose gui-wm/mangowm ``` +## openSUSE +The package is in the community-maintained repository called obs. + +```bash +sudo opi in mangowm +``` ## Fedora Linux The package is in the third-party Terra repository. First, add the [Terra Repository](https://terra.fyralabs.com/). diff --git a/docs/faq.md b/docs/faq.md index 13c6391b..9c9288de 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -41,11 +41,10 @@ blur_optimized=0 ### My games are lagging or stuttering -Try enabling **SyncObj** timeline support and **Adaptive Sync** (VRR) if your monitor supports it. +Try enabling **SyncObj** timeline support. ```ini syncobj_enable=1 -adaptive_sync=1 ``` --- diff --git a/docs/quick-start.md b/docs/quick-start.md index 85f67cc2..bc192474 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -64,7 +64,7 @@ To get a fully functional desktop experience, we recommend installing the follow | Terminal Emulator | foot, wezterm, alacritty, kitty, ghostty | | Status Bar | waybar, eww, quickshell, ags | | Desktop Shell | Noctalia, DankMaterialShell | -| Wallpaper Setup | swww, swaybg | +| Wallpaper Setup | awww(swww), swaybg | | Notification Daemon | swaync, dunst, mako | | Desktop Portal | xdg-desktop-portal, xdg-desktop-portal-wlr, xdg-desktop-portal-gtk | | Clipboard | wl-clipboard, wl-clip-persist, cliphist | diff --git a/meson.build b/meson.build index 64394cd9..ca9f2c2b 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('mango', ['c', 'cpp'], - version : '0.12.8', + version : '0.12.9', ) subdir('protocols') diff --git a/mmsg/mmsg.c b/mmsg/mmsg.c index 0191a635..69f1d1d0 100644 --- a/mmsg/mmsg.c +++ b/mmsg/mmsg.c @@ -603,120 +603,49 @@ int32_t main(int32_t argc, char *argv[]) { mode = SET; char *arg = EARGF(usage()); - // Trim leading and trailing whitespace from entire argument first - while (isspace(*arg)) - arg++; - char *end = arg + strlen(arg) - 1; - while (end > arg && isspace(*end)) - end--; - *(end + 1) = '\0'; + dispatch_cmd = dispatch_arg1 = dispatch_arg2 = dispatch_arg3 = + dispatch_arg4 = dispatch_arg5 = ""; - dispatch_cmd = arg; - char *comma1 = strchr(arg, ','); - if (comma1) { - *comma1 = '\0'; + char *tokens[6] = {0}; + int count = 0; - // Trim trailing whitespace from command - end = dispatch_cmd + strlen(dispatch_cmd) - 1; - while (end > dispatch_cmd && isspace(*end)) - end--; - *(end + 1) = '\0'; + while (arg && count < 6) { + char *comma = (count < 5) ? strchr(arg, ',') : NULL; + if (comma) { + *comma = '\0'; + tokens[count++] = arg; + arg = comma + 1; + } else { + tokens[count++] = arg; + break; + } + } - dispatch_arg1 = comma1 + 1; - // Trim leading whitespace from arg1 - while (isspace(*dispatch_arg1)) - dispatch_arg1++; - - // Trim trailing whitespace from arg1 before looking for next - // comma - end = dispatch_arg1 + strlen(dispatch_arg1) - 1; - while (end > dispatch_arg1 && isspace(*end)) - end--; - *(end + 1) = '\0'; - - char *comma2 = strchr(dispatch_arg1, ','); - if (comma2) { - *comma2 = '\0'; - dispatch_arg2 = comma2 + 1; - // Trim leading whitespace from arg2 - while (isspace(*dispatch_arg2)) - dispatch_arg2++; - - // Trim trailing whitespace from arg2 before looking for - // next comma - end = dispatch_arg2 + strlen(dispatch_arg2) - 1; - while (end > dispatch_arg2 && isspace(*end)) + for (int i = 0; i < count; i++) { + char *str = tokens[i]; + while (isspace((unsigned char)*str)) + str++; + if (*str) { + char *end = str + strlen(str) - 1; + while (end > str && isspace((unsigned char)*end)) end--; *(end + 1) = '\0'; - - char *comma3 = strchr(dispatch_arg2, ','); - if (comma3) { - *comma3 = '\0'; - dispatch_arg3 = comma3 + 1; - // Trim leading whitespace from arg3 - while (isspace(*dispatch_arg3)) - dispatch_arg3++; - - // Trim trailing whitespace from arg3 before looking for - // next comma - end = dispatch_arg3 + strlen(dispatch_arg3) - 1; - while (end > dispatch_arg3 && isspace(*end)) - end--; - *(end + 1) = '\0'; - - char *comma4 = strchr(dispatch_arg3, ','); - if (comma4) { - *comma4 = '\0'; - dispatch_arg4 = comma4 + 1; - // Trim leading whitespace from arg4 - while (isspace(*dispatch_arg4)) - dispatch_arg4++; - - // Trim trailing whitespace from arg4 before looking - // for next comma - end = dispatch_arg4 + strlen(dispatch_arg4) - 1; - while (end > dispatch_arg4 && isspace(*end)) - end--; - *(end + 1) = '\0'; - - char *comma5 = strchr(dispatch_arg4, ','); - if (comma5) { - *comma5 = '\0'; - dispatch_arg5 = comma5 + 1; - // Trim leading whitespace from arg5 - while (isspace(*dispatch_arg5)) - dispatch_arg5++; - - // Trim trailing whitespace from arg5 - end = dispatch_arg5 + strlen(dispatch_arg5) - 1; - while (end > dispatch_arg5 && isspace(*end)) - end--; - *(end + 1) = '\0'; - } else { - dispatch_arg5 = ""; - } - } else { - dispatch_arg4 = ""; - dispatch_arg5 = ""; - } - } else { - dispatch_arg3 = ""; - dispatch_arg4 = ""; - dispatch_arg5 = ""; - } - } else { - dispatch_arg2 = ""; - dispatch_arg3 = ""; - dispatch_arg4 = ""; - dispatch_arg5 = ""; } - } else { - dispatch_arg1 = ""; - dispatch_arg2 = ""; - dispatch_arg3 = ""; - dispatch_arg4 = ""; - dispatch_arg5 = ""; + tokens[i] = str; } + + if (count > 0) + dispatch_cmd = tokens[0]; + if (count > 1) + dispatch_arg1 = tokens[1]; + if (count > 2) + dispatch_arg2 = tokens[2]; + if (count > 3) + dispatch_arg3 = tokens[3]; + if (count > 4) + dispatch_arg4 = tokens[4]; + if (count > 5) + dispatch_arg5 = tokens[5]; } break; case 'O': diff --git a/src/client/client.h b/src/client/client.h index 965b4106..27e8ef33 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -312,11 +312,6 @@ static inline uint32_t client_set_size(Client *c, uint32_t width, int32_t width = c->geom.width - 2 * c->bw; int32_t height = c->geom.height - 2 * c->bw; - if (c->mon && c->mon->isoverview && size_hints && - c->geom.width - 2 * (int32_t)c->bw < size_hints->min_width && - c->geom.height - 2 * (int32_t)c->bw < size_hints->min_height) - return 0; - if (size_hints && c->geom.width - 2 * (int32_t)c->bw < size_hints->min_width) width = size_hints->min_width; diff --git a/src/mango.c b/src/mango.c index a13bf4e1..5c3c854d 100644 --- a/src/mango.c +++ b/src/mango.c @@ -1570,12 +1570,17 @@ void applyrules(Client *c) { int32_t fullscreen_state_backup = c->isfullscreen || client_wants_fullscreen(c); - setmon(c, mon, newtags, - !c->isopensilent && - !(client_is_x11_popup(c) && client_should_ignore_focus(c)) && - mon && - (!c->istagsilent || !newtags || - newtags & mon->tagset[mon->seltags])); + bool should_init_get_focus = + !c->isopensilent && + !(client_is_x11_popup(c) && client_should_ignore_focus(c)) && mon && + (!c->istagsilent || !newtags || newtags & mon->tagset[mon->seltags]); + + if (!should_init_get_focus) { + wl_list_remove(&c->flink); + wl_list_insert(fstack.prev, &c->flink); + } + + setmon(c, mon, newtags, should_init_get_focus); if (!c->isfloating) { c->old_stack_inner_per = c->stack_inner_per; @@ -4219,6 +4224,7 @@ mapnotify(struct wl_listener *listener, void *data) { } } else wl_list_insert(clients.prev, &c->link); // 尾部入栈 + wl_list_insert(&fstack, &c->flink); applyrules(c); @@ -4386,20 +4392,23 @@ void motionnotify(uint32_t time, struct wlr_input_device *device, double dx, if (active_constraint && cursor_mode != CurResize && cursor_mode != CurMove) { - toplevel_from_wlr_surface(active_constraint->surface, &c, NULL); - if (c && active_constraint->surface == - seat->pointer_state.focused_surface) { - sx = cursor->x - c->geom.x - c->bw; - sy = cursor->y - c->geom.y - c->bw; - if (wlr_region_confine(&active_constraint->region, sx, sy, - sx + dx, sy + dy, &sx_confined, - &sy_confined)) { - dx = sx_confined - sx; - dy = sy_confined - sy; - } + if (active_constraint->surface == + seat->pointer_state.focused_surface) { if (active_constraint->type == WLR_POINTER_CONSTRAINT_V1_LOCKED) return; + + toplevel_from_wlr_surface(active_constraint->surface, &c, NULL); + if (c) { + sx = cursor->x - c->geom.x - c->bw; + sy = cursor->y - c->geom.y - c->bw; + if (wlr_region_confine(&active_constraint->region, sx, sy, + sx + dx, sy + dy, &sx_confined, + &sy_confined)) { + dx = sx_confined - sx; + dy = sy_confined - sy; + } + } } } @@ -6325,10 +6334,14 @@ void view_in_mon(const Arg *arg, bool want_animation, Monitor *m, } if (arg->ui == UINT32_MAX) { - m->pertag->prevtag = get_tags_first_tag_num(m->tagset[m->seltags]); - m->seltags ^= 1; /* toggle sel tagset */ - m->pertag->curtag = get_tags_first_tag_num(m->tagset[m->seltags]); - goto toggleseltags; + if (m->tagset[0] != m->tagset[1]) { + m->pertag->prevtag = get_tags_first_tag_num(m->tagset[m->seltags]); + m->seltags ^= 1; /* toggle sel tagset */ + m->pertag->curtag = get_tags_first_tag_num(m->tagset[m->seltags]); + goto toggleseltags; + } else { + return; + } } if ((m->tagset[m->seltags] & arg->ui & TAGMASK) != 0) {