mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-03 06:46:38 -04:00
Merge branch 'mangowm:main' into main
This commit is contained in:
commit
ed75994442
7 changed files with 79 additions and 137 deletions
|
|
@ -95,6 +95,12 @@ Finally, install the package:
|
||||||
emerge --ask --verbose gui-wm/mangowm
|
emerge --ask --verbose gui-wm/mangowm
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## openSUSE
|
||||||
|
The package is in the community-maintained repository called obs.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo opi in mangowm
|
||||||
|
```
|
||||||
## Fedora Linux
|
## Fedora Linux
|
||||||
The package is in the third-party Terra repository.
|
The package is in the third-party Terra repository.
|
||||||
First, add the [Terra Repository](https://terra.fyralabs.com/).
|
First, add the [Terra Repository](https://terra.fyralabs.com/).
|
||||||
|
|
|
||||||
|
|
@ -41,11 +41,10 @@ blur_optimized=0
|
||||||
|
|
||||||
### My games are lagging or stuttering
|
### 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
|
```ini
|
||||||
syncobj_enable=1
|
syncobj_enable=1
|
||||||
adaptive_sync=1
|
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ To get a fully functional desktop experience, we recommend installing the follow
|
||||||
| Terminal Emulator | foot, wezterm, alacritty, kitty, ghostty |
|
| Terminal Emulator | foot, wezterm, alacritty, kitty, ghostty |
|
||||||
| Status Bar | waybar, eww, quickshell, ags |
|
| Status Bar | waybar, eww, quickshell, ags |
|
||||||
| Desktop Shell | Noctalia, DankMaterialShell |
|
| Desktop Shell | Noctalia, DankMaterialShell |
|
||||||
| Wallpaper Setup | swww, swaybg |
|
| Wallpaper Setup | awww(swww), swaybg |
|
||||||
| Notification Daemon | swaync, dunst, mako |
|
| Notification Daemon | swaync, dunst, mako |
|
||||||
| Desktop Portal | xdg-desktop-portal, xdg-desktop-portal-wlr, xdg-desktop-portal-gtk |
|
| Desktop Portal | xdg-desktop-portal, xdg-desktop-portal-wlr, xdg-desktop-portal-gtk |
|
||||||
| Clipboard | wl-clipboard, wl-clip-persist, cliphist |
|
| Clipboard | wl-clipboard, wl-clip-persist, cliphist |
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
project('mango', ['c', 'cpp'],
|
project('mango', ['c', 'cpp'],
|
||||||
version : '0.12.8',
|
version : '0.12.9',
|
||||||
)
|
)
|
||||||
|
|
||||||
subdir('protocols')
|
subdir('protocols')
|
||||||
|
|
|
||||||
143
mmsg/mmsg.c
143
mmsg/mmsg.c
|
|
@ -603,120 +603,49 @@ int32_t main(int32_t argc, char *argv[]) {
|
||||||
mode = SET;
|
mode = SET;
|
||||||
char *arg = EARGF(usage());
|
char *arg = EARGF(usage());
|
||||||
|
|
||||||
// Trim leading and trailing whitespace from entire argument first
|
dispatch_cmd = dispatch_arg1 = dispatch_arg2 = dispatch_arg3 =
|
||||||
while (isspace(*arg))
|
dispatch_arg4 = dispatch_arg5 = "";
|
||||||
arg++;
|
|
||||||
char *end = arg + strlen(arg) - 1;
|
|
||||||
while (end > arg && isspace(*end))
|
|
||||||
end--;
|
|
||||||
*(end + 1) = '\0';
|
|
||||||
|
|
||||||
dispatch_cmd = arg;
|
char *tokens[6] = {0};
|
||||||
char *comma1 = strchr(arg, ',');
|
int count = 0;
|
||||||
if (comma1) {
|
|
||||||
*comma1 = '\0';
|
|
||||||
|
|
||||||
// Trim trailing whitespace from command
|
while (arg && count < 6) {
|
||||||
end = dispatch_cmd + strlen(dispatch_cmd) - 1;
|
char *comma = (count < 5) ? strchr(arg, ',') : NULL;
|
||||||
while (end > dispatch_cmd && isspace(*end))
|
if (comma) {
|
||||||
end--;
|
*comma = '\0';
|
||||||
*(end + 1) = '\0';
|
tokens[count++] = arg;
|
||||||
|
arg = comma + 1;
|
||||||
|
} else {
|
||||||
|
tokens[count++] = arg;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dispatch_arg1 = comma1 + 1;
|
for (int i = 0; i < count; i++) {
|
||||||
// Trim leading whitespace from arg1
|
char *str = tokens[i];
|
||||||
while (isspace(*dispatch_arg1))
|
while (isspace((unsigned char)*str))
|
||||||
dispatch_arg1++;
|
str++;
|
||||||
|
if (*str) {
|
||||||
// Trim trailing whitespace from arg1 before looking for next
|
char *end = str + strlen(str) - 1;
|
||||||
// comma
|
while (end > str && isspace((unsigned char)*end))
|
||||||
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))
|
|
||||||
end--;
|
end--;
|
||||||
*(end + 1) = '\0';
|
*(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 {
|
tokens[i] = str;
|
||||||
dispatch_arg1 = "";
|
|
||||||
dispatch_arg2 = "";
|
|
||||||
dispatch_arg3 = "";
|
|
||||||
dispatch_arg4 = "";
|
|
||||||
dispatch_arg5 = "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
break;
|
||||||
case 'O':
|
case 'O':
|
||||||
|
|
|
||||||
|
|
@ -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 width = c->geom.width - 2 * c->bw;
|
||||||
int32_t height = c->geom.height - 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 &&
|
if (size_hints &&
|
||||||
c->geom.width - 2 * (int32_t)c->bw < size_hints->min_width)
|
c->geom.width - 2 * (int32_t)c->bw < size_hints->min_width)
|
||||||
width = size_hints->min_width;
|
width = size_hints->min_width;
|
||||||
|
|
|
||||||
55
src/mango.c
55
src/mango.c
|
|
@ -1570,12 +1570,17 @@ void applyrules(Client *c) {
|
||||||
int32_t fullscreen_state_backup =
|
int32_t fullscreen_state_backup =
|
||||||
c->isfullscreen || client_wants_fullscreen(c);
|
c->isfullscreen || client_wants_fullscreen(c);
|
||||||
|
|
||||||
setmon(c, mon, newtags,
|
bool should_init_get_focus =
|
||||||
!c->isopensilent &&
|
!c->isopensilent &&
|
||||||
!(client_is_x11_popup(c) && client_should_ignore_focus(c)) &&
|
!(client_is_x11_popup(c) && client_should_ignore_focus(c)) && mon &&
|
||||||
mon &&
|
(!c->istagsilent || !newtags || newtags & mon->tagset[mon->seltags]);
|
||||||
(!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) {
|
if (!c->isfloating) {
|
||||||
c->old_stack_inner_per = c->stack_inner_per;
|
c->old_stack_inner_per = c->stack_inner_per;
|
||||||
|
|
@ -4219,6 +4224,7 @@ mapnotify(struct wl_listener *listener, void *data) {
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
wl_list_insert(clients.prev, &c->link); // 尾部入栈
|
wl_list_insert(clients.prev, &c->link); // 尾部入栈
|
||||||
|
|
||||||
wl_list_insert(&fstack, &c->flink);
|
wl_list_insert(&fstack, &c->flink);
|
||||||
|
|
||||||
applyrules(c);
|
applyrules(c);
|
||||||
|
|
@ -4386,20 +4392,23 @@ void motionnotify(uint32_t time, struct wlr_input_device *device, double dx,
|
||||||
|
|
||||||
if (active_constraint && cursor_mode != CurResize &&
|
if (active_constraint && cursor_mode != CurResize &&
|
||||||
cursor_mode != CurMove) {
|
cursor_mode != CurMove) {
|
||||||
toplevel_from_wlr_surface(active_constraint->surface, &c, NULL);
|
if (active_constraint->surface ==
|
||||||
if (c && active_constraint->surface ==
|
seat->pointer_state.focused_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->type == WLR_POINTER_CONSTRAINT_V1_LOCKED)
|
if (active_constraint->type == WLR_POINTER_CONSTRAINT_V1_LOCKED)
|
||||||
return;
|
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) {
|
if (arg->ui == UINT32_MAX) {
|
||||||
m->pertag->prevtag = get_tags_first_tag_num(m->tagset[m->seltags]);
|
if (m->tagset[0] != m->tagset[1]) {
|
||||||
m->seltags ^= 1; /* toggle sel tagset */
|
m->pertag->prevtag = get_tags_first_tag_num(m->tagset[m->seltags]);
|
||||||
m->pertag->curtag = get_tags_first_tag_num(m->tagset[m->seltags]);
|
m->seltags ^= 1; /* toggle sel tagset */
|
||||||
goto toggleseltags;
|
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) {
|
if ((m->tagset[m->seltags] & arg->ui & TAGMASK) != 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue