feat: add isoverlay to winrule option

This commit is contained in:
DreamMaoMao 2025-05-26 15:43:36 +08:00
parent b539b4bf9a
commit c835f8e35b
2 changed files with 12 additions and 1 deletions

View file

@ -30,6 +30,7 @@ typedef struct {
int isopenscratchpad;
int isunglobal;
int isglobal;
int isoverlay;
int monitor;
int offsetx;
int offsety;
@ -1077,6 +1078,7 @@ void parse_config_line(Config *config, const char *line) {
rule->isopenscratchpad = -1;
rule->isunglobal = -1;
rule->isglobal = -1;
rule->isoverlay = -1;
rule->isterm = -1;
rule->noswallow = -1;
rule->monitor = -1;
@ -1141,6 +1143,8 @@ void parse_config_line(Config *config, const char *line) {
rule->isunglobal = atoi(val);
} else if (strcmp(key, "isglobal") == 0) {
rule->isglobal = atoi(val);
} else if (strcmp(key, "isoverlay") == 0) {
rule->isoverlay = atoi(val);
} else if (strcmp(key, "isterm") == 0) {
rule->isterm = atoi(val);
} else if (strcmp(key, "noswallow") == 0) {

View file

@ -1848,6 +1848,7 @@ applyrules(Client *c) {
c->isopensilent = r->isopensilent > 0 ? r->isopensilent : c->isopensilent;
c->isopenscratchpad = r->isopenscratchpad > 0 ? r->isopenscratchpad : c->isopenscratchpad;
c->isglobal = r->isglobal > 0 ? r->isglobal : c->isglobal;
c->isoverlay = r->isoverlay > 0 ? r->isoverlay : c->isoverlay;
c->isglobal = r->isunglobal > 0 && (client_is_unmanaged(c) || client_should_ignore_focus(c)) ? r->isunglobal : c->isglobal;
newtags = r->tags > 0 ? r->tags | newtags : newtags;
i = 0;
@ -1911,8 +1912,14 @@ applyrules(Client *c) {
if(c->isopenscratchpad) {
apply_named_scratchpad(c);
setborder_color(c);
}
if(c->isoverlay) {
wlr_scene_node_reparent(&selmon->sel->scene->node, layers[LyrOverlay]);
wlr_scene_node_raise_to_top(&selmon->sel->scene->node);
}
setborder_color(c);
}
void // 17