opt: optimize window bounds set and grabc optimize

grabc not trigger hotarea
grabc not set bound
This commit is contained in:
DreamMaoMao 2025-05-03 08:20:05 +08:00
parent 719c50de65
commit 4b0d3bde28

View file

@ -1227,9 +1227,9 @@ void applybounds(Client *c, struct wlr_box *bbox) {
c->geom.x = bbox->x + bbox->width - c->geom.width; c->geom.x = bbox->x + bbox->width - c->geom.width;
if (c->geom.y >= bbox->y + bbox->height) if (c->geom.y >= bbox->y + bbox->height)
c->geom.y = bbox->y + bbox->height - c->geom.height; c->geom.y = bbox->y + bbox->height - c->geom.height;
if (c->geom.x + c->geom.width <= bbox->x) if (c->geom.x <= bbox->x)
c->geom.x = bbox->x; c->geom.x = bbox->x;
if (c->geom.y + c->geom.height <= bbox->y) if (c->geom.y <= bbox->y)
c->geom.y = bbox->y; c->geom.y = bbox->y;
} }
@ -1472,6 +1472,9 @@ void toggle_hotarea(int x_root, int y_root) {
if (!selmon) if (!selmon)
return; return;
if(grabc)
return;
unsigned hx = selmon->m.x + hotarea_size; unsigned hx = selmon->m.x + hotarea_size;
unsigned hy = selmon->m.y + selmon->m.height - hotarea_size; unsigned hy = selmon->m.y + selmon->m.height - hotarea_size;
@ -4797,7 +4800,7 @@ void resize(Client *c, struct wlr_box geo, int interact) {
if (strcmp(c->mon->pertag->ltidxs[c->mon->pertag->curtag]->name, if (strcmp(c->mon->pertag->ltidxs[c->mon->pertag->curtag]->name,
"scroller") == 0 && "scroller") == 0 &&
!c->isfloating) { (!c->isfloating || c == grabc)) {
c->geom = geo; c->geom = geo;
c->geom.width = MAX(1 + 2 * (int)c->bw, c->geom.width); c->geom.width = MAX(1 + 2 * (int)c->bw, c->geom.width);
c->geom.height = MAX(1 + 2 * (int)c->bw, c->geom.height); c->geom.height = MAX(1 + 2 * (int)c->bw, c->geom.height);