optimize:remove the redundant resize

This commit is contained in:
DreamMaoMao 2025-04-21 23:00:09 +08:00
parent 4456f4536a
commit fd6b1d20fd
2 changed files with 7 additions and 4 deletions

View File

@ -366,9 +366,8 @@ client_set_tiled(Client *c, uint32_t edges)
if (wl_resource_get_version(c->surface.xdg->toplevel->resource)
>= XDG_TOPLEVEL_STATE_TILED_RIGHT_SINCE_VERSION) {
wlr_xdg_toplevel_set_tiled(c->surface.xdg->toplevel, edges);
} else {
wlr_xdg_toplevel_set_maximized(c->surface.xdg->toplevel, edges != WLR_EDGE_NONE);
}
wlr_xdg_toplevel_set_maximized(c->surface.xdg->toplevel, edges != WLR_EDGE_NONE);
}
static inline void

8
dwl.c
View File

@ -869,17 +869,21 @@ commitnotify(struct wl_listener *listener, void *data)
wlr_xdg_toplevel_set_wm_capabilities(c->surface.xdg->toplevel,
WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT | WLR_EDGE_RIGHT);
if (c->decoration)
requestdecorationmode(&c->set_decoration_mode, c->decoration);
wlr_xdg_toplevel_set_size(c->surface.xdg->toplevel, 0, 0);
return;
}
resize(c, c->geom, (c->isfloating && !c->isfullscreen));
if(!c->resize)
return;
/* mark a pending resize as completed */
if (c->resize && c->resize <= c->surface.xdg->current.configure_serial)
if (c->resize && c->resize <= c->surface.xdg->current.configure_serial) {
c->resize = 0;
wlr_output_schedule_frame(c->mon->wlr_output);
}
}
void