diff --git a/config.def.h b/config.def.h index 3ab0170..849ffa1 100644 --- a/config.def.h +++ b/config.def.h @@ -32,10 +32,11 @@ static const char *const autostart[] = { /* NOTE: ALWAYS keep a rule declared even if you don't use rules (e.g leave at least one example) */ static const Rule rules[] = { - /* app_id title tags mask isfloating monitor */ + /* app_id title tags mask isfloating skipfocus monitor */ /* examples: */ - { "Gimp_EXAMPLE", NULL, 0, 1, -1 }, /* Start on currently visible tags floating, not tiled */ - { "firefox_EXAMPLE", NULL, 1 << 8, 0, -1 }, /* Start on ONLY tag "9" */ + { "Gimp_EXAMPLE", NULL, 0, 1, 0, -1 }, /* Start on currently visible tags floating, not tiled */ + { "firefox_EXAMPLE", NULL, 1 << 8, 0, 0, -1 }, /* Start on ONLY tag "9" */ + { "mako_EXAMPLE", NULL, 0, 1, 1, -1 }, /* Start floating and skip focus }; /* layout(s) */ diff --git a/dwl.c b/dwl.c index de9b97c..e7cfbcf 100644 --- a/dwl.c +++ b/dwl.c @@ -142,7 +142,7 @@ typedef struct { #endif unsigned int bw; uint32_t tags; - int isfloating, isurgent, isfullscreen; + int isfloating, isurgent, isfullscreen, skipfocus; uint32_t resize; /* configure serial of a pending resize */ } Client; @@ -241,6 +241,7 @@ typedef struct { const char *title; uint32_t tags; int isfloating; + int skipfocus; int monitor; } Rule; @@ -510,6 +511,7 @@ applyrules(Client *c) if ((!r->title || strstr(title, r->title)) && (!r->id || strstr(appid, r->id))) { c->isfloating = r->isfloating; + c->skipfocus = r->skipfocus; newtags |= r->tags; i = 0; wl_list_for_each(m, &mons, link) { @@ -1692,6 +1694,13 @@ focusclient(Client *c, int lift) if (locked) return; + if (c && c->skipfocus != 0){ + if (c -> skipfocus == 1) { + c->skipfocus = 0; + } + return; + } + /* Raise client in stacking order if requested */ if (c && lift) wlr_scene_node_raise_to_top(&c->scene->node); @@ -2099,11 +2108,13 @@ mapnotify(struct wl_listener *listener, void *data) printstatus(); unset_fullscreen: - m = c->mon ? c->mon : xytomon(c->geom.x, c->geom.y); - wl_list_for_each(w, &clients, link) { - if (w != c && w != p && w->isfullscreen && m == w->mon && (w->tags & c->tags)) - setfullscreen(w, 0); - } + if (!c->skipfocus) { + m = c->mon ? c->mon : xytomon(c->geom.x, c->geom.y); + wl_list_for_each(w, &clients, link) { + if (w != c && w != p && w->isfullscreen && m == w->mon && (w->tags & c->tags)) + setfullscreen(w, 0); + } + } } void