diff options
| -rw-r--r-- | config.def.h | 5 | ||||
| -rw-r--r-- | dwl.c | 27 |
2 files changed, 28 insertions, 4 deletions
diff --git a/config.def.h b/config.def.h index 28e340c..6d4ccd0 100644 --- a/config.def.h +++ b/config.def.h @@ -154,11 +154,12 @@ static const Key keys[] = { { MODKEY, XKB_KEY_Tab, view, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, killclient, {0} }, { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} }, - { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} }, + //{ MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} }, { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} }, { MODKEY, XKB_KEY_space, setlayout, {0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_space, togglefloating, {0} }, - { MODKEY, XKB_KEY_e, togglefullscreen, {0} }, + { MODKEY, XKB_KEY_f, togglefullscreen, {0} }, + { MODKEY, XKB_KEY_s, togglesticky, {0} }, { MODKEY, XKB_KEY_0, view, {.ui = ~0} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_parenright, tag, {.ui = ~0} }, { MODKEY, XKB_KEY_comma, focusmon, {.i = WLR_DIRECTION_LEFT} }, @@ -75,7 +75,7 @@ #define MAX(A, B) ((A) > (B) ? (A) : (B)) #define MIN(A, B) ((A) < (B) ? (A) : (B)) #define CLEANMASK(mask) (mask & ~WLR_MODIFIER_CAPS) -#define VISIBLEON(C, M) ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags])) +#define VISIBLEON(C, M) ((M) && (C)->mon == (M) && (((C)->tags & (M)->tagset[(M)->seltags]) || C->issticky)) #define LENGTH(X) (sizeof X / sizeof X[0]) #define END(A) ((A) + LENGTH(A)) #define TAGMASK ((1u << TAGCOUNT) - 1) @@ -142,7 +142,7 @@ typedef struct { #endif unsigned int bw; uint32_t tags; - int isfloating, isurgent, isfullscreen; + int isfloating, isurgent, isfullscreen, issticky; char scratchkey; uint32_t resize; /* configure serial of a pending resize */ } Client; @@ -337,6 +337,7 @@ static void setmfact(const Arg *arg); static void setmon(Client *c, Monitor *m, uint32_t newtags); static void setpsel(struct wl_listener *listener, void *data); static void setsel(struct wl_listener *listener, void *data); +static void setsticky(Client *c, int sticky); static void setup(void); static void spawn(const Arg *arg); static void spawnscratch(const Arg *arg); @@ -345,6 +346,7 @@ static void tag(const Arg *arg); static void tagmon(const Arg *arg); static void tile(Monitor *m); static void togglefloating(const Arg *arg); +static void togglesticky(const Arg *arg); static void togglefullscreen(const Arg *arg); static void togglescratch(const Arg *arg); static void toggletag(const Arg *arg); @@ -2426,6 +2428,17 @@ setfullscreen(Client *c, int fullscreen) } void +setsticky(Client *c, int sticky) +{ + if(sticky && !c->issticky) { + c->issticky = 1; + } else if(!sticky && c->issticky) { + c->issticky = 0; + arrange(c->mon); + } +} + +void setlayout(const Arg *arg) { if (!selmon) @@ -2858,6 +2871,16 @@ togglescratch(const Arg *arg) } void +togglesticky(const Arg *arg) +{ + Client *c = focustop(selmon); + if(!c) + return; + + setsticky(c, !c->issticky); +} + +void toggletag(const Arg *arg) { uint32_t newtags; |
