feat: add windowrule option isnoshadow,isnoanimation

This commit is contained in:
DreamMaoMao
2025-11-06 19:01:18 +08:00
parent 40b6f82823
commit 5b60999075
3 changed files with 18 additions and 1 deletions

View File

@@ -251,7 +251,7 @@ void buffer_set_effect(Client *c, BufferData data) {
void client_draw_shadow(Client *c) {
if (c->iskilling || !client_surface(c)->mapped)
if (c->iskilling || !client_surface(c)->mapped || c->isnoshadow)
return;
if (!shadows || (!c->isfloating && shadow_only_floating)) {
@@ -888,6 +888,11 @@ void client_set_pending_state(Client *c) {
c->animation.duration = 0;
}
if (c->isnoanimation) {
c->animation.should_animate = false;
c->animation.duration = 0;
}
// 开始动画
client_commit(c);
c->dirty = true;

View File

@@ -61,6 +61,8 @@ typedef struct {
const char *layer_animation_type_open;
const char *layer_animation_type_close;
int isnoborder;
int isnoshadow;
int isnoanimation;
int isopensilent;
int istagsilent;
int isnamedscratchpad;
@@ -1697,6 +1699,8 @@ void parse_option(Config *config, char *key, char *value) {
rule->isfloating = -1;
rule->isfullscreen = -1;
rule->isnoborder = -1;
rule->isnoshadow = -1;
rule->isnoanimation = -1;
rule->isopensilent = -1;
rule->istagsilent = -1;
rule->isnamedscratchpad = -1;
@@ -1778,6 +1782,10 @@ void parse_option(Config *config, char *key, char *value) {
rule->height = atoi(val);
} else if (strcmp(key, "isnoborder") == 0) {
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) {
rule->isopensilent = atoi(val);
} else if (strcmp(key, "istagsilent") == 0) {

View File

@@ -330,6 +330,8 @@ struct Client {
int is_scratchpad_show;
int isglobal;
int isnoborder;
int isnoshadow;
int isnoanimation;
int isopensilent;
int istagsilent;
int iskilling;
@@ -1134,6 +1136,8 @@ static void apply_rule_properties(Client *c, const ConfigWinRule *r) {
APPLY_INT_PROP(c, r, isfloating);
APPLY_INT_PROP(c, r, isfullscreen);
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, istagsilent);
APPLY_INT_PROP(c, r, isnamedscratchpad);