From fd6b1d20fdc004f92291f049a6e0f9c1bad5f723 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Mon, 21 Apr 2025 23:00:09 +0800 Subject: [PATCH] optimize:remove the redundant resize --- client.h | 3 +-- dwl.c | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client.h b/client.h index f1e2ab5..1867933 100644 --- a/client.h +++ b/client.h @@ -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 diff --git a/dwl.c b/dwl.c index 4816159..f243219 100644 --- a/dwl.c +++ b/dwl.c @@ -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