mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	invoke_swaybar(): Set process group. Kill process group.
Fixes a bug where terminate_swaybar() did not terminate swaybar.
This commit is contained in:
		
							parent
							
								
									64e0731cc7
								
							
						
					
					
						commit
						b9726afd48
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -17,7 +17,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void terminate_swaybar(pid_t pid) {
 | 
					static void terminate_swaybar(pid_t pid) {
 | 
				
			||||||
	wlr_log(L_DEBUG, "Terminating swaybar %d", pid);
 | 
						wlr_log(L_DEBUG, "Terminating swaybar %d", pid);
 | 
				
			||||||
	int ret = kill(pid, SIGTERM);
 | 
						int ret = kill(-pid, SIGTERM);
 | 
				
			||||||
	if (ret != 0) {
 | 
						if (ret != 0) {
 | 
				
			||||||
		wlr_log_errno(L_ERROR, "Unable to terminate swaybar %d", pid);
 | 
							wlr_log_errno(L_ERROR, "Unable to terminate swaybar %d", pid);
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
| 
						 | 
					@ -163,6 +163,7 @@ void invoke_swaybar(struct bar_config *bar) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	bar->pid = fork();
 | 
						bar->pid = fork();
 | 
				
			||||||
	if (bar->pid == 0) {
 | 
						if (bar->pid == 0) {
 | 
				
			||||||
 | 
							setpgid(0, 0);
 | 
				
			||||||
		close(filedes[0]);
 | 
							close(filedes[0]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// run custom swaybar
 | 
							// run custom swaybar
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue