mirror of
				https://codeberg.org/dwl/dwl-patches.git
				synced 2025-11-04 05:54:20 +00:00 
			
		
		
		
	update switchtotag
This commit is contained in:
		
							parent
							
								
									4ac941e1f1
								
							
						
					
					
						commit
						8f6a71e1e9
					
				@ -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>
 | 
					From: Guido Cella <guido@guidocella.xyz>
 | 
				
			||||||
Date: Tue, 16 Jan 2024 18:58:34 +0100
 | 
					Date: Tue, 16 Jan 2024 18:58:34 +0100
 | 
				
			||||||
Subject: [PATCH] allow switching to the configured tag when a window opens
 | 
					Subject: [PATCH] allow switching to the configured tag when a window opens
 | 
				
			||||||
@ -30,10 +30,10 @@ index 9009517..055ec93 100644
 | 
				
			|||||||
 
 | 
					 
 | 
				
			||||||
 /* layout(s) */
 | 
					 /* layout(s) */
 | 
				
			||||||
diff --git a/dwl.c b/dwl.c
 | 
					diff --git a/dwl.c b/dwl.c
 | 
				
			||||||
index f25ac2f..2874dc9 100644
 | 
					index d508d79..d05e815 100644
 | 
				
			||||||
--- a/dwl.c
 | 
					--- a/dwl.c
 | 
				
			||||||
+++ b/dwl.c
 | 
					+++ b/dwl.c
 | 
				
			||||||
@@ -134,6 +134,7 @@ typedef struct {
 | 
					@@ -138,6 +138,7 @@ typedef struct {
 | 
				
			||||||
 	unsigned int bw;
 | 
					 	unsigned int bw;
 | 
				
			||||||
 	uint32_t tags;
 | 
					 	uint32_t tags;
 | 
				
			||||||
 	int isfloating, isurgent, isfullscreen;
 | 
					 	int isfloating, isurgent, isfullscreen;
 | 
				
			||||||
@ -41,7 +41,7 @@ index f25ac2f..2874dc9 100644
 | 
				
			|||||||
 	uint32_t resize; /* configure serial of a pending resize */
 | 
					 	uint32_t resize; /* configure serial of a pending resize */
 | 
				
			||||||
 } Client;
 | 
					 } Client;
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
@@ -217,6 +218,7 @@ typedef struct {
 | 
					@@ -226,6 +227,7 @@ typedef struct {
 | 
				
			||||||
 	const char *id;
 | 
					 	const char *id;
 | 
				
			||||||
 	const char *title;
 | 
					 	const char *title;
 | 
				
			||||||
 	uint32_t tags;
 | 
					 	uint32_t tags;
 | 
				
			||||||
@ -49,7 +49,7 @@ index f25ac2f..2874dc9 100644
 | 
				
			|||||||
 	int isfloating;
 | 
					 	int isfloating;
 | 
				
			||||||
 	int monitor;
 | 
					 	int monitor;
 | 
				
			||||||
 } Rule;
 | 
					 } Rule;
 | 
				
			||||||
@@ -448,6 +450,11 @@ applyrules(Client *c)
 | 
					@@ -468,6 +470,11 @@ applyrules(Client *c)
 | 
				
			||||||
 				if (r->monitor == i++)
 | 
					 				if (r->monitor == i++)
 | 
				
			||||||
 					mon = m;
 | 
					 					mon = m;
 | 
				
			||||||
 			}
 | 
					 			}
 | 
				
			||||||
@ -60,11 +60,11 @@ index f25ac2f..2874dc9 100644
 | 
				
			|||||||
+			}
 | 
					+			}
 | 
				
			||||||
 		}
 | 
					 		}
 | 
				
			||||||
 	}
 | 
					 	}
 | 
				
			||||||
 	wlr_scene_node_reparent(&c->scene->node, layers[c->isfloating ? LyrFloat : LyrTile]);
 | 
					 	setmon(c, mon, newtags);
 | 
				
			||||||
@@ -2577,6 +2584,10 @@ unmapnotify(struct wl_listener *listener, void *data)
 | 
					@@ -2691,6 +2698,10 @@ unmapnotify(struct wl_listener *listener, void *data)
 | 
				
			||||||
 	wlr_scene_node_destroy(&c->scene->node);
 | 
					 	wlr_scene_node_destroy(&c->scene->node);
 | 
				
			||||||
 	printstatus();
 | 
					 	printstatus();
 | 
				
			||||||
 	motionnotify(0);
 | 
					 	motionnotify(0, NULL, 0, 0, 0, 0);
 | 
				
			||||||
+	if (c->switchtotag) {
 | 
					+	if (c->switchtotag) {
 | 
				
			||||||
+		Arg a = { .ui = c->switchtotag };
 | 
					+		Arg a = { .ui = c->switchtotag };
 | 
				
			||||||
+		view(&a);
 | 
					+		view(&a);
 | 
				
			||||||
@ -73,5 +73,5 @@ index f25ac2f..2874dc9 100644
 | 
				
			|||||||
 
 | 
					 
 | 
				
			||||||
 void
 | 
					 void
 | 
				
			||||||
-- 
 | 
					-- 
 | 
				
			||||||
2.43.0
 | 
					2.44.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user