Merge branch 'mangowm:main' into main

This commit is contained in:
Davide Greco 2026-04-26 20:07:36 +02:00 committed by GitHub
commit ed75994442
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 79 additions and 137 deletions

View file

@ -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;

View file

@ -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) {