mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	layers: handle top layer unmap/destroy better
On losing top layer focus, set focus on topmost mapped view.
This commit is contained in:
		
							parent
							
								
									5d6143449f
								
							
						
					
					
						commit
						a26fd5a75b
					
				
					 4 changed files with 47 additions and 2 deletions
				
			
		
							
								
								
									
										14
									
								
								src/seat.c
									
										
									
									
									
								
							
							
						
						
									
										14
									
								
								src/seat.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -124,3 +124,17 @@ seat_focus_surface(struct seat *seat, struct wlr_surface *surface)
 | 
			
		|||
	wlr_seat_keyboard_notify_enter(seat->seat, surface, kb->keycodes,
 | 
			
		||||
		kb->num_keycodes, &kb->modifiers);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
seat_set_focus_layer(struct seat *seat, struct wlr_layer_surface_v1 *layer)
 | 
			
		||||
{
 | 
			
		||||
	if (!layer) {
 | 
			
		||||
		seat->focused_layer = NULL;
 | 
			
		||||
		desktop_focus_topmost_mapped_view(seat->server);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	seat_focus_surface(seat, layer->surface);
 | 
			
		||||
	if (layer->current.layer >= ZWLR_LAYER_SHELL_V1_LAYER_TOP) {
 | 
			
		||||
		seat->focused_layer = layer;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue