mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Refocus the last focused container on lock exit
This commit is contained in:
		
							parent
							
								
									62a736a196
								
							
						
					
					
						commit
						3ede718c06
					
				
					 1 changed files with 10 additions and 3 deletions
				
			
		| 
						 | 
					@ -424,11 +424,18 @@ void seat_set_focus(struct sway_seat *seat,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void seat_set_focus_layer(struct sway_seat *seat,
 | 
					void seat_set_focus_layer(struct sway_seat *seat,
 | 
				
			||||||
		struct wlr_layer_surface *layer) {
 | 
							struct wlr_layer_surface *layer) {
 | 
				
			||||||
	if (!layer) {
 | 
						if (!layer && seat->focused_layer) {
 | 
				
			||||||
		seat->focused_layer = NULL;
 | 
							seat->focused_layer = NULL;
 | 
				
			||||||
 | 
							struct sway_container *c = seat_get_focus(seat);
 | 
				
			||||||
 | 
							if (c) {
 | 
				
			||||||
 | 
								wlr_log(L_DEBUG, "Returning focus to %p %s '%s'", c,
 | 
				
			||||||
 | 
										container_type_to_str(c->type), c->name);
 | 
				
			||||||
 | 
								// Hack to get seat to re-focus the return value of get_focus
 | 
				
			||||||
 | 
								seat_set_focus(seat, c->parent);
 | 
				
			||||||
 | 
								seat_set_focus(seat, c);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						} else if (!layer || seat->focused_layer == layer) {
 | 
				
			||||||
	if (seat->focused_layer == layer) {
 | 
					 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (seat->has_focus) {
 | 
						if (seat->has_focus) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue