opt: optimize init commit for no anim

This commit is contained in:
DreamMaoMao 2025-08-02 23:02:21 +08:00
parent b18ca70ac4
commit 3bf524929b
2 changed files with 10 additions and 10 deletions

View file

@ -902,6 +902,7 @@ void resize(Client *c, struct wlr_box geo, int interact) {
return;
c->need_output_flush = true;
c->dirty = true;
// oldgeom = c->geom;
bbox = (interact || c->isfloating || c->isfullscreen) ? &sgeom : &c->mon->w;

View file

@ -2181,8 +2181,9 @@ void commitnotify(struct wl_listener *listener, void *data) {
setmon(c, NULL, 0,
true); /* Make sure to reapply rules in mapnotify() */
client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT |
WLR_EDGE_RIGHT);
// client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT |
// WLR_EDGE_RIGHT);
uint32_t serial = wlr_xdg_surface_schedule_configure(c->surface.xdg);
if (serial > 0) {
c->configure_serial = serial;
@ -2203,17 +2204,15 @@ void commitnotify(struct wl_listener *listener, void *data) {
c->animation.tagining)
return;
if (c == grabc)
if (c == grabc || !c->dirty)
return;
struct wlr_box *new_geo = &c->surface.xdg->geometry;
bool need_resize = new_geo->width != c->geom.width - 2 * c->bw ||
new_geo->height != c->geom.height - 2 * c->bw ||
new_geo->x != 0 || new_geo->y != 0;
resize(c, c->geom, 0);
if (need_resize) {
resize(c, c->geom, 0);
}
struct wlr_box *new_geo = &c->surface.xdg->geometry;
c->dirty = new_geo->width != c->geom.width - 2 * c->bw ||
new_geo->height != c->geom.height - 2 * c->bw ||
new_geo->x != 0 || new_geo->y != 0;
}
void destroydecoration(struct wl_listener *listener, void *data) {