From c835f8e35b6681150b6b15449e6f60f0c2dd25cb Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Mon, 26 May 2025 15:43:36 +0800 Subject: [PATCH] feat: add isoverlay to winrule option --- src/config/parse_config.h | 4 ++++ src/maomao.c | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/config/parse_config.h b/src/config/parse_config.h index 56914e7..ab30d91 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -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) { diff --git a/src/maomao.c b/src/maomao.c index 381adb5..628a88f 100644 --- a/src/maomao.c +++ b/src/maomao.c @@ -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