From 9941bf97526bc758165ebce510dfc815ea43d57b Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Wed, 15 Oct 2025 21:24:41 +0800 Subject: [PATCH] rollback: remove force_tile_state option Since the non-tiled state can cause the size of some Windows to be out of sync with the synthesizer's expectations, all Windows are set to the tiled state by default again --- src/client/client.h | 4 +--- src/config/parse_config.h | 4 ---- src/mango.c | 30 ++++-------------------------- 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/src/client/client.h b/src/client/client.h index 3c6e0ab..2436bd9 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -356,9 +356,7 @@ static inline void 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, - WLR_EDGE_TOP | WLR_EDGE_BOTTOM | - WLR_EDGE_LEFT | WLR_EDGE_RIGHT); + wlr_xdg_toplevel_set_tiled(c->surface.xdg->toplevel, edges); } if (!c->ignore_maximize) { diff --git a/src/config/parse_config.h b/src/config/parse_config.h index 4145fb9..d6a8c37 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -72,7 +72,6 @@ typedef struct { int no_force_center; int isterm; int allow_csd; - int force_tile_state; int noswallow; int noblur; float focused_opacity; @@ -1547,7 +1546,6 @@ void parse_option(Config *config, char *key, char *value) { rule->isnosizehint = -1; rule->isterm = -1; rule->allow_csd = -1; - rule->force_tile_state = -1; rule->noswallow = -1; rule->noblur = -1; rule->nofadein = -1; @@ -1642,8 +1640,6 @@ void parse_option(Config *config, char *key, char *value) { rule->isterm = atoi(val); } else if (strcmp(key, "allow_csd") == 0) { rule->allow_csd = atoi(val); - } else if (strcmp(key, "force_tile_state") == 0) { - rule->force_tile_state = atoi(val); } else if (strcmp(key, "noswallow") == 0) { rule->noswallow = atoi(val); } else if (strcmp(key, "noblur") == 0) { diff --git a/src/mango.c b/src/mango.c index f1c483b..e84fe16 100644 --- a/src/mango.c +++ b/src/mango.c @@ -325,7 +325,6 @@ struct Client { struct dwl_animation animation; int isterm, noswallow; int allow_csd; - int force_tile_state; pid_t pid; Client *swallowing, *swallowedby; bool is_clip_to_hide; @@ -1131,7 +1130,6 @@ void toggle_hotarea(int x_root, int y_root) { static void apply_rule_properties(Client *c, const ConfigWinRule *r) { APPLY_INT_PROP(c, r, isterm); APPLY_INT_PROP(c, r, allow_csd); - APPLY_INT_PROP(c, r, force_tile_state); APPLY_INT_PROP(c, r, noswallow); APPLY_INT_PROP(c, r, nofadein); APPLY_INT_PROP(c, r, nofadeout); @@ -2260,9 +2258,8 @@ void commitnotify(struct wl_listener *listener, void *data) { setmon(c, NULL, 0, true); /* Make sure to reapply rules in mapnotify() */ - if (c->force_tile_state) - 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) { @@ -3524,7 +3521,6 @@ void init_client_properties(Client *c) { c->stack_innder_per = 0.0f; c->isterm = 0; c->allow_csd = 0; - c->force_tile_state = 1; } void // old fix to 0.5 @@ -3632,9 +3628,8 @@ mapnotify(struct wl_listener *listener, void *data) { applyrules(c); } - if (c->force_tile_state) - 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); // apply buffer effects of client wlr_scene_node_for_each_buffer(&c->scene_surface->node, @@ -4422,15 +4417,6 @@ setfloating(Client *c, int floating) { set_size_per(c->mon, c); } - if (!c->force_tile_state) { - if (c->isfloating) { - client_set_tiled(c, WLR_EDGE_NONE); - } else { - client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT | - WLR_EDGE_RIGHT); - } - } - arrange(c->mon, false); setborder_color(c); printstatus(); @@ -4484,14 +4470,6 @@ void setmaxmizescreen(Client *c, int maxmizescreen) { set_size_per(c->mon, c); } - if (!c->ismaxmizescreen && !c->force_tile_state && c->isfloating) { - client_set_tiled(c, WLR_EDGE_NONE); - - } else { - client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT | - WLR_EDGE_RIGHT); - } - arrange(c->mon, false); }