mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Restore focus when unmapping layer shell surfaces
This commit is contained in:
		
							parent
							
								
									74799937cf
								
							
						
					
					
						commit
						9253278328
					
				
					 2 changed files with 7 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -257,6 +257,11 @@ static void unmap(struct sway_layer_surface *sway_layer) {
 | 
			
		|||
	}
 | 
			
		||||
	output_damage_surface(output, sway_layer->geo.x, sway_layer->geo.y,
 | 
			
		||||
		sway_layer->layer_surface->surface, true);
 | 
			
		||||
 | 
			
		||||
	struct sway_seat *seat = input_manager_current_seat(input_manager);
 | 
			
		||||
	if (seat->focused_layer == sway_layer->layer_surface) {
 | 
			
		||||
		seat_set_focus_layer(seat, NULL);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void handle_destroy(struct wl_listener *listener, void *data) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -658,7 +658,8 @@ void seat_set_focus_layer(struct sway_seat *seat,
 | 
			
		|||
		struct wlr_layer_surface *layer) {
 | 
			
		||||
	if (!layer && seat->focused_layer) {
 | 
			
		||||
		seat->focused_layer = NULL;
 | 
			
		||||
		struct sway_container *previous = seat_get_focus(seat);
 | 
			
		||||
		struct sway_container *previous =
 | 
			
		||||
			seat_get_focus_inactive(seat, &root_container);
 | 
			
		||||
		if (previous) {
 | 
			
		||||
			wlr_log(L_DEBUG, "Returning focus to %p %s '%s'", previous,
 | 
			
		||||
					container_type_to_str(previous->type), previous->name);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue