opt: default maximize all client

This commit is contained in:
DreamMaoMao 2025-08-10 12:25:08 +08:00
parent 9ba301ce0f
commit 906c64c041
3 changed files with 14 additions and 18 deletions

View file

@ -350,8 +350,6 @@ static inline uint32_t client_set_size(Client *c, uint32_t width,
static inline void client_set_tiled(Client *c, uint32_t edges) {
struct wlr_xdg_toplevel *toplevel;
struct wlr_xdg_toplevel_state state;
bool need_maximize = false;
#ifdef XWAYLAND
if (client_is_x11(c)) {
wlr_xwayland_surface_set_maximized(c->surface.xwayland,
@ -362,21 +360,13 @@ static inline void client_set_tiled(Client *c, uint32_t edges) {
#endif
toplevel = c->surface.xdg->toplevel;
state = toplevel->current;
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 {
need_maximize = true;
}
// exclude some windows that cannot be maximized,
// such as the login window of linuxqq
if (state.min_width == 0 || state.min_height == 0)
need_maximize = false;
if (need_maximize) {
if (!c->ignore_maximize) {
wlr_xdg_toplevel_set_maximized(toplevel, edges != WLR_EDGE_NONE);
}
}