mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-10-29 05:40:21 -04:00
feat: add istagsilent option to windowrule
This commit is contained in:
parent
9ec80f0918
commit
053f9976a6
2 changed files with 14 additions and 6 deletions
|
|
@ -46,6 +46,7 @@ typedef struct {
|
||||||
const char *layer_animation_type_close;
|
const char *layer_animation_type_close;
|
||||||
int isnoborder;
|
int isnoborder;
|
||||||
int isopensilent;
|
int isopensilent;
|
||||||
|
int istagsilent;
|
||||||
int isnamedscratchpad;
|
int isnamedscratchpad;
|
||||||
int isunglobal;
|
int isunglobal;
|
||||||
int isglobal;
|
int isglobal;
|
||||||
|
|
@ -1409,6 +1410,7 @@ void parse_config_line(Config *config, const char *line) {
|
||||||
rule->isfullscreen = -1;
|
rule->isfullscreen = -1;
|
||||||
rule->isnoborder = -1;
|
rule->isnoborder = -1;
|
||||||
rule->isopensilent = -1;
|
rule->isopensilent = -1;
|
||||||
|
rule->istagsilent = -1;
|
||||||
rule->isnamedscratchpad = -1;
|
rule->isnamedscratchpad = -1;
|
||||||
rule->isunglobal = -1;
|
rule->isunglobal = -1;
|
||||||
rule->isglobal = -1;
|
rule->isglobal = -1;
|
||||||
|
|
@ -1486,6 +1488,8 @@ void parse_config_line(Config *config, const char *line) {
|
||||||
rule->isnoborder = atoi(val);
|
rule->isnoborder = 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) {
|
||||||
|
rule->istagsilent = atoi(val);
|
||||||
} else if (strcmp(key, "isnamedscratchpad") == 0) {
|
} else if (strcmp(key, "isnamedscratchpad") == 0) {
|
||||||
rule->isnamedscratchpad = atoi(val);
|
rule->isnamedscratchpad = atoi(val);
|
||||||
} else if (strcmp(key, "isunglobal") == 0) {
|
} else if (strcmp(key, "isunglobal") == 0) {
|
||||||
|
|
|
||||||
16
src/mango.c
16
src/mango.c
|
|
@ -289,6 +289,7 @@ struct Client {
|
||||||
int isglobal;
|
int isglobal;
|
||||||
int isnoborder;
|
int isnoborder;
|
||||||
int isopensilent;
|
int isopensilent;
|
||||||
|
int istagsilent;
|
||||||
int iskilling;
|
int iskilling;
|
||||||
int isnamedscratchpad;
|
int isnamedscratchpad;
|
||||||
bool is_pending_open_animation;
|
bool is_pending_open_animation;
|
||||||
|
|
@ -1043,6 +1044,7 @@ static void apply_rule_properties(Client *c, const ConfigWinRule *r) {
|
||||||
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, isopensilent);
|
APPLY_INT_PROP(c, r, isopensilent);
|
||||||
|
APPLY_INT_PROP(c, r, istagsilent);
|
||||||
APPLY_INT_PROP(c, r, isnamedscratchpad);
|
APPLY_INT_PROP(c, r, isnamedscratchpad);
|
||||||
APPLY_INT_PROP(c, r, isglobal);
|
APPLY_INT_PROP(c, r, isglobal);
|
||||||
APPLY_INT_PROP(c, r, isoverlay);
|
APPLY_INT_PROP(c, r, isoverlay);
|
||||||
|
|
@ -1196,7 +1198,9 @@ void applyrules(Client *c) {
|
||||||
int fullscreen_state_backup = c->isfullscreen || client_wants_fullscreen(c);
|
int fullscreen_state_backup = c->isfullscreen || client_wants_fullscreen(c);
|
||||||
setmon(c, mon, newtags, !c->isopensilent);
|
setmon(c, mon, newtags, !c->isopensilent);
|
||||||
|
|
||||||
if (!c->isopensilent && c->mon &&
|
if (!c->isopensilent &&
|
||||||
|
(!c->istagsilent || c->tags & c->mon->tagset[c->mon->seltags]) &&
|
||||||
|
c->mon &&
|
||||||
((c->mon && c->mon != selmon) ||
|
((c->mon && c->mon != selmon) ||
|
||||||
!(c->tags & (1 << (c->mon->pertag->curtag - 1))))) {
|
!(c->tags & (1 << (c->mon->pertag->curtag - 1))))) {
|
||||||
c->animation.tag_from_rule = true;
|
c->animation.tag_from_rule = true;
|
||||||
|
|
@ -4329,14 +4333,14 @@ void setmon(Client *c, Monitor *m, unsigned int newtags, bool focus) {
|
||||||
setfloating(c, c->isfloating);
|
setfloating(c, c->isfloating);
|
||||||
setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
|
setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
|
||||||
}
|
}
|
||||||
if (focus)
|
if (m && focus && (!c->istagsilent || c->tags & m->tagset[m->seltags]))
|
||||||
focusclient(focustop(selmon), 1);
|
focusclient(focustop(m), 1);
|
||||||
|
|
||||||
if (!c->foreign_toplevel && c->mon) {
|
if (!c->foreign_toplevel && m) {
|
||||||
add_foreign_toplevel(c);
|
add_foreign_toplevel(c);
|
||||||
if (selmon->sel && selmon->sel->foreign_toplevel)
|
if (m->sel && m->sel->foreign_toplevel)
|
||||||
wlr_foreign_toplevel_handle_v1_set_activated(
|
wlr_foreign_toplevel_handle_v1_set_activated(
|
||||||
selmon->sel->foreign_toplevel, false);
|
m->sel->foreign_toplevel, false);
|
||||||
if (c->foreign_toplevel)
|
if (c->foreign_toplevel)
|
||||||
wlr_foreign_toplevel_handle_v1_set_activated(c->foreign_toplevel,
|
wlr_foreign_toplevel_handle_v1_set_activated(c->foreign_toplevel,
|
||||||
true);
|
true);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue