opt: add force_maximize

sf
This commit is contained in:
DreamMaoMao
2025-10-15 22:37:26 +08:00
parent 9941bf9752
commit 4954711b3b
3 changed files with 33 additions and 3 deletions

View File

@@ -325,6 +325,7 @@ struct Client {
struct dwl_animation animation;
int isterm, noswallow;
int allow_csd;
int force_maximize;
pid_t pid;
Client *swallowing, *swallowedby;
bool is_clip_to_hide;
@@ -1130,6 +1131,7 @@ 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_maximize);
APPLY_INT_PROP(c, r, noswallow);
APPLY_INT_PROP(c, r, nofadein);
APPLY_INT_PROP(c, r, nofadeout);
@@ -3521,6 +3523,7 @@ void init_client_properties(Client *c) {
c->stack_innder_per = 0.0f;
c->isterm = 0;
c->allow_csd = 0;
c->force_maximize = 1;
}
void // old fix to 0.5
@@ -3540,7 +3543,8 @@ mapnotify(struct wl_listener *listener, void *data) {
client_get_geometry(c, &c->geom);
init_client_properties(c);
if (client_is_x11(c))
init_client_properties(c);
// set special window properties
if (client_is_unmanaged(c) || client_should_ignore_focus(c)) {
@@ -4126,9 +4130,10 @@ void requestdecorationmode(struct wl_listener *listener, void *data) {
// 如果客户端没有指定,使用默认模式
if (!c->allow_csd) {
requested_mode = WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE;
} else if (requested_mode ==
WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE) {
}
// 尊重客户端的请求
wlr_xdg_toplevel_decoration_v1_set_mode(c->decoration, requested_mode);
}
}
@@ -4470,6 +4475,12 @@ void setmaxmizescreen(Client *c, int maxmizescreen) {
set_size_per(c->mon, c);
}
if (!c->force_maximize && !c->ismaxmizescreen) {
client_set_maximized(c, false);
} else {
client_set_maximized(c, true);
}
arrange(c->mon, false);
}