~ruther/dwl

a55e94d1e7a3b95bb17e54e98c2b6aa760809cac — Rutherther 11 months ago adc7e1f + 5ceef97
Merge branch 'patch/sticky' into v0.6-a/patched-base
1 files changed, 25 insertions(+), 2 deletions(-)

M dwl.c
M dwl.c => dwl.c +25 -2
@@ 72,7 72,7 @@
#define MIN(A, B)               ((A) < (B) ? (A) : (B))
#define ROUND(X)                ((int)((X < 0) ? (X - 0.5) : (X + 0.5)))
#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)


@@ 139,7 139,7 @@ struct Client {
#endif
	unsigned int bw;
	uint32_t tags;
	int isfloating, isurgent, isfullscreen, isterm, noswallow;
	int isfloating, isurgent, isfullscreen, isterm, noswallow, issticky;
	uint32_t resize; /* configure serial of a pending resize */
	pid_t pid;
	Client *swallowing, *swallowedby;


@@ 328,6 328,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);


@@ 342,6 343,7 @@ static void tagmon(const Arg *arg);
static void tagnthmon(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 toggletag(const Arg *arg);
static void toggleview(const Arg *arg);


@@ 2409,6 2411,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)


@@ 2850,6 2863,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)
{
	uint32_t newtags;

Do not follow this link