feat: add windowrule option isnoshadow,isnoanimation

This commit is contained in:
DreamMaoMao 2025-11-06 19:01:18 +08:00
parent 649cfdb54c
commit beaa4ce902
3 changed files with 18 additions and 1 deletions

View file

@ -230,7 +230,7 @@ void buffer_set_effect(Client *c, BufferData data) {
void apply_border(Client *c) { void apply_border(Client *c) {
bool hit_no_border = false; bool hit_no_border = false;
if (c->iskilling || !client_surface(c)->mapped) if (c->iskilling || !client_surface(c)->mapped || c->isnoshadow)
return; return;
hit_no_border = check_hit_no_border(c); hit_no_border = check_hit_no_border(c);
@ -767,6 +767,11 @@ void client_set_pending_state(Client *c) {
c->animation.duration = 0; c->animation.duration = 0;
} }
if (c->isnoanimation) {
c->animation.should_animate = false;
c->animation.duration = 0;
}
// 开始动画 // 开始动画
client_commit(c); client_commit(c);
c->dirty = true; c->dirty = true;

View file

@ -61,6 +61,8 @@ typedef struct {
const char *layer_animation_type_open; const char *layer_animation_type_open;
const char *layer_animation_type_close; const char *layer_animation_type_close;
int isnoborder; int isnoborder;
int isnoshadow;
int isnoanimation;
int isopensilent; int isopensilent;
int istagsilent; int istagsilent;
int isnamedscratchpad; int isnamedscratchpad;
@ -1634,6 +1636,8 @@ void parse_option(Config *config, char *key, char *value) {
rule->isfloating = -1; rule->isfloating = -1;
rule->isfullscreen = -1; rule->isfullscreen = -1;
rule->isnoborder = -1; rule->isnoborder = -1;
rule->isnoshadow = -1;
rule->isnoanimation = -1;
rule->isopensilent = -1; rule->isopensilent = -1;
rule->istagsilent = -1; rule->istagsilent = -1;
rule->isnamedscratchpad = -1; rule->isnamedscratchpad = -1;
@ -1714,6 +1718,10 @@ void parse_option(Config *config, char *key, char *value) {
rule->height = atoi(val); rule->height = atoi(val);
} else if (strcmp(key, "isnoborder") == 0) { } else if (strcmp(key, "isnoborder") == 0) {
rule->isnoborder = atoi(val); rule->isnoborder = atoi(val);
} else if (strcmp(key, "isnoshadow") == 0) {
rule->isnoshadow = atoi(val);
} else if (strcmp(key, "isnoanimation") == 0) {
rule->isnoanimation = atoi(val);
} else if (strcmp(key, "isopensilent") == 0) { } else if (strcmp(key, "isopensilent") == 0) {
rule->isopensilent = atoi(val); rule->isopensilent = atoi(val);
} else if (strcmp(key, "istagsilent") == 0) { } else if (strcmp(key, "istagsilent") == 0) {

View file

@ -330,6 +330,8 @@ struct Client {
int is_scratchpad_show; int is_scratchpad_show;
int isglobal; int isglobal;
int isnoborder; int isnoborder;
int isnoshadow;
int isnoanimation;
int isopensilent; int isopensilent;
int istagsilent; int istagsilent;
int iskilling; int iskilling;
@ -1144,6 +1146,8 @@ static void apply_rule_properties(Client *c, const ConfigWinRule *r) {
APPLY_INT_PROP(c, r, isfloating); APPLY_INT_PROP(c, r, isfloating);
APPLY_INT_PROP(c, r, isfullscreen); APPLY_INT_PROP(c, r, isfullscreen);
APPLY_INT_PROP(c, r, isnoborder); APPLY_INT_PROP(c, r, isnoborder);
APPLY_INT_PROP(c, r, isnoshadow);
APPLY_INT_PROP(c, r, isnoanimation);
APPLY_INT_PROP(c, r, isopensilent); APPLY_INT_PROP(c, r, isopensilent);
APPLY_INT_PROP(c, r, istagsilent); APPLY_INT_PROP(c, r, istagsilent);
APPLY_INT_PROP(c, r, isnamedscratchpad); APPLY_INT_PROP(c, r, isnamedscratchpad);