update switchtotag

This commit is contained in:
Guido Cella 2024-03-11 18:45:48 +01:00
parent 4ac941e1f1
commit 8f6a71e1e9

View File

@ -1,4 +1,4 @@
From b7618500ee1cf95f2e264cb0380b5332a79ffacb Mon Sep 17 00:00:00 2001
From ef817db56044ac28a2da5bc8a56381883a5bba7d Mon Sep 17 00:00:00 2001
From: Guido Cella <guido@guidocella.xyz>
Date: Tue, 16 Jan 2024 18:58:34 +0100
Subject: [PATCH] allow switching to the configured tag when a window opens
@ -30,10 +30,10 @@ index 9009517..055ec93 100644
/* layout(s) */
diff --git a/dwl.c b/dwl.c
index f25ac2f..2874dc9 100644
index d508d79..d05e815 100644
--- a/dwl.c
+++ b/dwl.c
@@ -134,6 +134,7 @@ typedef struct {
@@ -138,6 +138,7 @@ typedef struct {
unsigned int bw;
uint32_t tags;
int isfloating, isurgent, isfullscreen;
@ -41,7 +41,7 @@ index f25ac2f..2874dc9 100644
uint32_t resize; /* configure serial of a pending resize */
} Client;
@@ -217,6 +218,7 @@ typedef struct {
@@ -226,6 +227,7 @@ typedef struct {
const char *id;
const char *title;
uint32_t tags;
@ -49,7 +49,7 @@ index f25ac2f..2874dc9 100644
int isfloating;
int monitor;
} Rule;
@@ -448,6 +450,11 @@ applyrules(Client *c)
@@ -468,6 +470,11 @@ applyrules(Client *c)
if (r->monitor == i++)
mon = m;
}
@ -60,11 +60,11 @@ index f25ac2f..2874dc9 100644
+ }
}
}
wlr_scene_node_reparent(&c->scene->node, layers[c->isfloating ? LyrFloat : LyrTile]);
@@ -2577,6 +2584,10 @@ unmapnotify(struct wl_listener *listener, void *data)
setmon(c, mon, newtags);
@@ -2691,6 +2698,10 @@ unmapnotify(struct wl_listener *listener, void *data)
wlr_scene_node_destroy(&c->scene->node);
printstatus();
motionnotify(0);
motionnotify(0, NULL, 0, 0, 0, 0);
+ if (c->switchtotag) {
+ Arg a = { .ui = c->switchtotag };
+ view(&a);
@ -73,5 +73,5 @@ index f25ac2f..2874dc9 100644
void
--
2.43.0
2.44.0