|
|
|
@@ -1,8 +1,8 @@
|
|
|
|
|
diff --git a/dwl.c b/dwl.c
|
|
|
|
|
index e6bb8c6..d7a6e55 100644
|
|
|
|
|
index ae39203..2e60842 100644
|
|
|
|
|
--- a/dwl.c
|
|
|
|
|
+++ b/dwl.c
|
|
|
|
|
@@ -245,6 +245,7 @@ static void arrange(Monitor *m);
|
|
|
|
|
@@ -234,6 +234,7 @@ static void arrange(Monitor *m);
|
|
|
|
|
static void arrangelayer(Monitor *m, struct wl_list *list,
|
|
|
|
|
struct wlr_box *usable_area, int exclusive);
|
|
|
|
|
static void arrangelayers(Monitor *m);
|
|
|
|
@@ -10,14 +10,15 @@ index e6bb8c6..d7a6e55 100644
|
|
|
|
|
static void autostartexec(void);
|
|
|
|
|
static void axisnotify(struct wl_listener *listener, void *data);
|
|
|
|
|
static void buttonpress(struct wl_listener *listener, void *data);
|
|
|
|
|
@@ -271,5 +272,6 @@ static void focusmon(const Arg *arg);
|
|
|
|
|
@@ -271,6 +272,7 @@ static void focusmon(const Arg *arg);
|
|
|
|
|
static void focusstack(const Arg *arg);
|
|
|
|
|
static Client *focustop(Monitor *m);
|
|
|
|
|
static void fullscreennotify(struct wl_listener *listener, void *data);
|
|
|
|
|
+static size_t getunusedtag(void);
|
|
|
|
|
static void handlesig(int signo);
|
|
|
|
|
static void incnmaster(const Arg *arg);
|
|
|
|
|
@@ -554,6 +556,15 @@ arrangelayer(Monitor *m, struct wl_list *list, struct wlr_box *usable_area, int
|
|
|
|
|
static void inputdevice(struct wl_listener *listener, void *data);
|
|
|
|
|
@@ -538,6 +540,15 @@ arrangelayer(Monitor *m, struct wl_list *list, struct wlr_box *usable_area, int
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -33,7 +34,7 @@ index e6bb8c6..d7a6e55 100644
|
|
|
|
|
void
|
|
|
|
|
arrangelayers(Monitor *m)
|
|
|
|
|
{
|
|
|
|
|
@@ -986,7 +997,7 @@ createmon(struct wl_listener *listener, void *data)
|
|
|
|
|
@@ -970,7 +981,7 @@ createmon(struct wl_listener *listener, void *data)
|
|
|
|
|
m->gappiv = gappiv;
|
|
|
|
|
m->gappoh = gappoh;
|
|
|
|
|
m->gappov = gappov;
|
|
|
|
@@ -42,7 +43,7 @@ index e6bb8c6..d7a6e55 100644
|
|
|
|
|
for (r = monrules; r < END(monrules); r++) {
|
|
|
|
|
if (!r->name || strstr(wlr_output->name, r->name)) {
|
|
|
|
|
m->mfact = r->mfact;
|
|
|
|
|
@@ -1498,6 +1509,22 @@ fullscreennotify(struct wl_listener *listener, void *data)
|
|
|
|
|
@@ -1455,6 +1466,26 @@ fullscreennotify(struct wl_listener *listener, void *data)
|
|
|
|
|
setfullscreen(c, client_wants_fullscreen(c));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -50,14 +51,18 @@ index e6bb8c6..d7a6e55 100644
|
|
|
|
|
+getunusedtag(void)
|
|
|
|
|
+{
|
|
|
|
|
+ size_t i = 0;
|
|
|
|
|
+ bool empty = true;
|
|
|
|
|
+ Monitor *m;
|
|
|
|
|
+ if (wl_list_empty(&mons))
|
|
|
|
|
+ return i;
|
|
|
|
|
+ for (i=0; i < TAGCOUNT; i++) {
|
|
|
|
|
+ wl_list_for_each(m, &mons, link) {
|
|
|
|
|
+ if (!(m->tagset[m->seltags] & (1<<i)))
|
|
|
|
|
+ return i;
|
|
|
|
|
+ if (m->tagset[m->seltags] & (1<<i))
|
|
|
|
|
+ empty = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (empty)
|
|
|
|
|
+ return i;
|
|
|
|
|
+ empty = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ return i;
|
|
|
|
|
+}
|
|
|
|
@@ -65,7 +70,7 @@ index e6bb8c6..d7a6e55 100644
|
|
|
|
|
void
|
|
|
|
|
handlesig(int signo)
|
|
|
|
|
{
|
|
|
|
|
@@ -2055,8 +2082,6 @@ printstatus(void)
|
|
|
|
|
@@ -1999,8 +2030,6 @@ printstatus(void)
|
|
|
|
|
wl_list_for_each(m, &mons, link) {
|
|
|
|
|
occ = urg = 0;
|
|
|
|
|
wl_list_for_each(c, &clients, link) {
|
|
|
|
@@ -74,7 +79,7 @@ index e6bb8c6..d7a6e55 100644
|
|
|
|
|
occ |= c->tags;
|
|
|
|
|
if (c->isurgent)
|
|
|
|
|
urg |= c->tags;
|
|
|
|
|
@@ -2562,22 +2587,32 @@ startdrag(struct wl_listener *listener, void *data)
|
|
|
|
|
@@ -2504,22 +2533,32 @@ startdrag(struct wl_listener *listener, void *data)
|
|
|
|
|
void
|
|
|
|
|
tag(const Arg *arg)
|
|
|
|
|
{
|
|
|
|
@@ -109,7 +114,7 @@ index e6bb8c6..d7a6e55 100644
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
@@ -2645,6 +2680,7 @@ togglefullscreen(const Arg *arg)
|
|
|
|
|
@@ -2587,6 +2626,7 @@ togglefullscreen(const Arg *arg)
|
|
|
|
|
void
|
|
|
|
|
toggletag(const Arg *arg)
|
|
|
|
|
{
|
|
|
|
@@ -117,7 +122,7 @@ index e6bb8c6..d7a6e55 100644
|
|
|
|
|
uint32_t newtags;
|
|
|
|
|
Client *sel = focustop(selmon);
|
|
|
|
|
if (!sel)
|
|
|
|
|
@@ -2653,7 +2689,11 @@ toggletag(const Arg *arg)
|
|
|
|
|
@@ -2595,7 +2635,11 @@ toggletag(const Arg *arg)
|
|
|
|
|
if (!newtags)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
@@ -129,7 +134,7 @@ index e6bb8c6..d7a6e55 100644
|
|
|
|
|
focusclient(focustop(selmon), 1);
|
|
|
|
|
arrange(selmon);
|
|
|
|
|
printstatus();
|
|
|
|
|
@@ -2662,12 +2702,17 @@ toggletag(const Arg *arg)
|
|
|
|
|
@@ -2604,12 +2648,17 @@ toggletag(const Arg *arg)
|
|
|
|
|
void
|
|
|
|
|
toggleview(const Arg *arg)
|
|
|
|
|
{
|
|
|
|
@@ -147,11 +152,12 @@ index e6bb8c6..d7a6e55 100644
|
|
|
|
|
focusclient(focustop(selmon), 1);
|
|
|
|
|
arrange(selmon);
|
|
|
|
|
printstatus();
|
|
|
|
|
@@ -2836,15 +2881,38 @@ urgent(struct wl_listener *listener, void *data)
|
|
|
|
|
@@ -2778,15 +2827,41 @@ urgent(struct wl_listener *listener, void *data)
|
|
|
|
|
void
|
|
|
|
|
view(const Arg *arg)
|
|
|
|
|
{
|
|
|
|
|
+ Monitor *m, *origm = selmon;
|
|
|
|
|
+ Client *c;
|
|
|
|
|
+ unsigned int newtags = selmon->tagset[selmon->seltags ^ 1];
|
|
|
|
|
+
|
|
|
|
|
if (!selmon || (arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) {
|
|
|
|
@@ -167,7 +173,7 @@ index e6bb8c6..d7a6e55 100644
|
|
|
|
|
- arrange(selmon);
|
|
|
|
|
+ newtags = arg->ui & TAGMASK;
|
|
|
|
|
+ wl_list_for_each(m, &mons, link) {
|
|
|
|
|
+ if (m != selmon && newtags & m->tagset[m->seltags]) {
|
|
|
|
|
+ if (m != selmon && newtags & m->tagset[m->seltags] && m->wlr_output->enabled) {
|
|
|
|
|
+ /* prevent displaying all tags (MODKEY-0) when multiple monitors
|
|
|
|
|
+ * are connected */
|
|
|
|
|
+ if (newtags & selmon->tagset[selmon->seltags])
|
|
|
|
@@ -175,7 +181,8 @@ index e6bb8c6..d7a6e55 100644
|
|
|
|
|
+ m->seltags ^= 1;
|
|
|
|
|
+ m->tagset[m->seltags] = selmon->tagset[selmon->seltags];
|
|
|
|
|
+ attachclients(m);
|
|
|
|
|
+ focusclient(focustop(m), 1);
|
|
|
|
|
+ // disabled since i preffer keeping focus on the current monitor
|
|
|
|
|
+ // focusclient(focustop(m), 1);
|
|
|
|
|
+ arrange(m);
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
@@ -185,7 +192,8 @@ index e6bb8c6..d7a6e55 100644
|
|
|
|
|
+ if (arg->ui & TAGMASK)
|
|
|
|
|
+ origm->tagset[origm->seltags] = arg->ui & TAGMASK;
|
|
|
|
|
+ attachclients(origm);
|
|
|
|
|
+ focusclient(focustop(origm), 1);
|
|
|
|
|
+ c = focustop(origm);
|
|
|
|
|
+ focusclient(c, 1);
|
|
|
|
|
+ arrange(origm);
|
|
|
|
|
printstatus();
|
|
|
|
|
}
|
|
|
|
|