~ruther/dwl

ec941a5934149ff5ae726d74e686cf89d086d333 — Rutherther 8 months ago 452b87b + 020cfcd
Merge branch 'v0.7/singletagset-sticky' into v0.7/patched-base
1 files changed, 26 insertions(+), 3 deletions(-)

M dwl.c
M dwl.c => dwl.c +26 -3
@@ 74,8 74,8 @@
#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 SVISIBLEON(C, M)        ((M) && (C)->mon && ((C)->tags & (M)->tagset[(M)->seltags]))
#define VISIBLEON(C, M)         ((M) && (C)->mon == (M) && (((C)->tags & (M)->tagset[(M)->seltags])) || (C)->issticky)
#define SVISIBLEON(C, M)        ((M) && (C)->mon && ((C)->tags & ((M)->tagset[(M)->seltags])) && (!(C)->issticky || (C)->mon == (M)))
#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;
	uint32_t resize; /* configure serial of a pending resize */
} Client;



@@ 359,6 359,7 @@ static void setcursor(struct wl_listener *listener, void *data);
static void setcursorshape(struct wl_listener *listener, void *data);
static void setfloating(Client *c, int floating);
static void setfullscreen(Client *c, int fullscreen);
static void setsticky(Client *c, int sticky);
static void setgamma(struct wl_listener *listener, void *data);
static void setlayout(const Arg *arg);
static void setmfact(const Arg *arg);


@@ 373,6 374,7 @@ static void tagmon(const Arg *arg);
static void tile(Monitor *m);
static void togglebar(const Arg *arg);
static void togglefloating(const Arg *arg);
static void togglesticky(const Arg *arg);
static void togglefullscreen(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);


@@ 2665,6 2667,17 @@ setgamma(struct wl_listener *listener, void *data)
}

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)


@@ 3089,6 3102,16 @@ togglefullscreen(const Arg *arg)
}

void
togglesticky(const Arg *arg)
{
	Client *c = focustop(selmon);
	if(!c)
		return;

	setsticky(c, !c->issticky);
}

void
toggletag(const Arg *arg)
{
	Monitor *m;

Do not follow this link