mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	close terminal window on exit
This commit is contained in:
		
							parent
							
								
									b6761dc294
								
							
						
					
					
						commit
						f71accc5b8
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
					@ -2268,6 +2268,9 @@ io_handler(GIOChannel   *source,
 | 
				
			||||||
	gsize bytes_read;
 | 
						gsize bytes_read;
 | 
				
			||||||
	GError *error = NULL;
 | 
						GError *error = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if(condition == G_IO_HUP)
 | 
				
			||||||
 | 
					          exit(0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	g_io_channel_read_chars(source, buffer, sizeof buffer,
 | 
						g_io_channel_read_chars(source, buffer, sizeof buffer,
 | 
				
			||||||
				&bytes_read, &error);
 | 
									&bytes_read, &error);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2298,8 +2301,8 @@ terminal_run(struct terminal *terminal, const char *path)
 | 
				
			||||||
	terminal->master = master;
 | 
						terminal->master = master;
 | 
				
			||||||
	terminal->channel = g_io_channel_unix_new(master);
 | 
						terminal->channel = g_io_channel_unix_new(master);
 | 
				
			||||||
	fcntl(master, F_SETFL, O_NONBLOCK);
 | 
						fcntl(master, F_SETFL, O_NONBLOCK);
 | 
				
			||||||
	g_io_add_watch(terminal->channel, G_IO_IN,
 | 
						g_io_add_watch(terminal->channel, G_IO_IN, io_handler, terminal);
 | 
				
			||||||
		       io_handler, terminal);
 | 
					        g_io_add_watch(terminal->channel, G_IO_HUP, io_handler, terminal);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue