feat: support group

feat: add dispatch groupleave

opt: optimize layer cover

fix: miss set client isgroupfocusing to false when it no group member

fix: fix miss hide bar node when disable animaitons

opt: allow floating window show group bar

opt: optimize layer cover when setfloating

opt: optimize size per set when setfloating

opt: optimize layer cover of floating group bar

opt: make groupbar same layer with its client

opt: optimize groupbar animation clip

fix: fix cant focus group membar when change mon

opt: optimize shadow and border drap when floating cross monitor

opt: optimize overlay layer set for group

fix: fix xytonode not exclue snapbuffer for client

opt: optmize structruing\

opt: add common for struct type

It must be placed first; otherwise, after the xytonode's null pointer is
forcibly converted, the reading type will encounter an incorrect address

fix: capture windows with subsurfaces
This commit is contained in:
DreamMaoMao 2026-06-20 18:44:28 +08:00
parent 722f6ab7bb
commit 1f9dbe7c3c
20 changed files with 863 additions and 456 deletions

View file

@ -188,8 +188,6 @@ Client *find_client_by_direction(Client *tc, const Arg *arg,
continue;
if (!findfloating && c->isfloating)
continue;
if (c->is_monocle_hide)
continue;
if (c->isunglobal)
continue;
if (!config.focus_cross_monitor && c->mon != tc->mon)
@ -197,11 +195,6 @@ Client *find_client_by_direction(Client *tc, const Arg *arg,
if (!(c->tags & c->mon->tagset[c->mon->seltags]))
continue;
if (step == 0 && ((!tc->mon->isoverview &&
!client_is_in_same_stack(tc, c, NULL)) ||
c->mon != tc->mon))
continue;
int32_t c_l = c->geom.x;
int32_t c_r = c->geom.x + c->geom.width;
int32_t c_t = c->geom.y;
@ -257,17 +250,24 @@ Client *find_client_by_direction(Client *tc, const Arg *arg,
if (!match_dir)
continue;
if (step == 0) {
if (c->mon != tc->mon)
continue;
if (!tc->mon->isoverview &&
!client_is_in_same_stack(tc, c, NULL))
continue;
if (orth_dist != 0)
continue;
}
int64_t penalty = 0;
if (main_dist < 0) {
penalty = 10000000000LL; // 主方向重叠(反方向)的极大惩罚
penalty = 10000000000LL;
main_dist = -main_dist;
}
// 正交方向无重叠惩罚,优先选择在同一行/列的窗口
int64_t no_overlap_penalty = 0;
if (orth_dist > 0) {
// LEFT/RIGHT 时 orth_dist 是垂直间距,>0 表示垂直无重叠
// UP/DOWN 时 orth_dist 是水平间距,>0 表示水平无重叠
no_overlap_penalty = 10000000LL;
}
@ -442,7 +442,7 @@ Client *get_focused_stack_client(Client *sc, Client *custom_focus_client) {
return sc;
wl_list_for_each(tc, &fstack, flink) {
if (tc->iskilling || tc->isunglobal || tc->is_monocle_hide)
if (tc->iskilling || tc->isunglobal)
continue;
if (!VISIBLEON(tc, sc->mon))
continue;

View file

@ -100,23 +100,30 @@ static bool layer_ignores_focus(LayerSurface *l) {
}
void xytonode(double x, double y, struct wlr_surface **psurface, Client **pc,
LayerSurface **pl, double *nx, double *ny) {
struct wlr_scene_node *node, *pnode;
LayerSurface **pl, MangoGroupBar **gb, double *nx, double *ny) {
struct wlr_scene_node *node = NULL, *pnode = NULL;
struct wlr_surface *surface = NULL;
Client *c = NULL;
LayerSurface *l = NULL;
MangoGroupBar *mangogroupbar = NULL;
int32_t layer;
Client *ovc = NULL;
for (layer = NUM_LAYERS - 1; !surface && layer >= 0; layer--) {
if (psurface)
*psurface = NULL;
if (pc)
*pc = NULL;
if (pl)
*pl = NULL;
if (gb)
*gb = NULL;
for (layer = NUM_LAYERS - 1; layer >= 0; layer--) {
if (layer == LyrFadeOut)
continue;
if (!(node = wlr_scene_node_at(&layers[layer]->node, x, y, nx, ny)))
continue;
if (!node->enabled)
node = wlr_scene_node_at(&layers[layer]->node, x, y, nx, ny);
if (!node)
continue;
if (node->type == WLR_SCENE_NODE_BUFFER) {
@ -125,23 +132,30 @@ void xytonode(double x, double y, struct wlr_surface **psurface, Client **pc,
wlr_scene_buffer_from_node(node));
if (scene_surface) {
surface = scene_surface->surface;
} else {
continue;
}
}
/* start from the topmost layer,
find a sureface that can be focused by pointer,
impopup neither a client nor a layer surface.*/
if (layer == LyrIMPopup) {
c = NULL;
l = NULL;
} else {
for (pnode = node; pnode && !c; pnode = &pnode->parent->node)
c = pnode->data;
if (c && c->type == LayerShell) {
l = (LayerSurface *)c;
c = NULL;
void *data = NULL;
for (pnode = node; pnode; pnode = &pnode->parent->node) {
if (pnode->data) {
data = pnode->data;
break;
}
}
if (data) {
Client *temp_c = (Client *)data;
if (temp_c->type == LayerShell) {
l = (LayerSurface *)temp_c;
} else if (temp_c->type == GroupBar) {
mangogroupbar = (MangoGroupBar *)temp_c;
} else if (temp_c->type == XDGShell || temp_c->type == X11) {
c = temp_c;
}
}
}
@ -149,8 +163,9 @@ void xytonode(double x, double y, struct wlr_surface **psurface, Client **pc,
if (c) {
surface = client_surface(c);
}
break;
}
break;
}
if (psurface)
@ -159,6 +174,8 @@ void xytonode(double x, double y, struct wlr_surface **psurface, Client **pc,
*pc = c;
if (pl)
*pl = l;
if (gb)
*gb = mangogroupbar;
if (selmon && selmon->isoverview && config.ov_no_resize) {
ovc = xytoclient(x, y);
@ -174,12 +191,12 @@ void xytonode(double x, double y, struct wlr_surface **psurface, Client **pc,
if (ovc && (!l || layer_ignores_focus(l) || is_below)) {
if (pc)
*pc = ovc;
if (psurface)
*psurface = ovc ? client_surface(ovc) : NULL;
if (pl && ovc)
if (pl)
*pl = NULL;
if (gb)
*gb = NULL;
}
}
}