mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	seat: Move focus back to first shell surface when unfocusing layer surface
This commit is contained in:
		
							parent
							
								
									df3f0ffbb0
								
							
						
					
					
						commit
						6345000b92
					
				
					 1 changed files with 9 additions and 1 deletions
				
			
		| 
						 | 
					@ -1441,7 +1441,15 @@ void roots_seat_set_focus(struct roots_seat *seat, struct roots_view *view) {
 | 
				
			||||||
void roots_seat_set_focus_layer(struct roots_seat *seat,
 | 
					void roots_seat_set_focus_layer(struct roots_seat *seat,
 | 
				
			||||||
		struct wlr_layer_surface_v1 *layer) {
 | 
							struct wlr_layer_surface_v1 *layer) {
 | 
				
			||||||
	if (!layer) {
 | 
						if (!layer) {
 | 
				
			||||||
 | 
							if (seat->focused_layer) {
 | 
				
			||||||
			seat->focused_layer = NULL;
 | 
								seat->focused_layer = NULL;
 | 
				
			||||||
 | 
								if (!wl_list_empty(&seat->views)) {
 | 
				
			||||||
 | 
									// Focus first view
 | 
				
			||||||
 | 
									struct roots_seat_view *first_seat_view = wl_container_of(
 | 
				
			||||||
 | 
										seat->views.next, first_seat_view, link);
 | 
				
			||||||
 | 
									roots_seat_set_focus(seat, first_seat_view->view);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat->seat);
 | 
						struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat->seat);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue