mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	workspaces: keep focus on omnipresent windows when switching workspaces
Fixes: #2329
This commit is contained in:
		
							parent
							
								
									13a58c58eb
								
							
						
					
					
						commit
						77d1747f1b
					
				
					 1 changed files with 10 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -339,12 +339,19 @@ workspaces_switch_to(struct workspace *target, bool update_focus)
 | 
			
		|||
	server->workspaces.current = target;
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * Make sure we are focusing what the user sees.
 | 
			
		||||
	 * Only refocus if the focus is not already on an always-on-top view.
 | 
			
		||||
	 * Make sure we are focusing what the user sees. Only refocus if
 | 
			
		||||
	 * the focus is not already on an omnipresent or always-on-top view.
 | 
			
		||||
	 *
 | 
			
		||||
	 * TODO: Decouple always-on-top views from the omnipresent state.
 | 
			
		||||
	 *       One option for that would be to create a new scene tree
 | 
			
		||||
	 *       as child of every workspace tree and then reparent a-o-t
 | 
			
		||||
	 *       windows to that one. Combined with adjusting the condition
 | 
			
		||||
	 *       below that should take care of the issue.
 | 
			
		||||
	 */
 | 
			
		||||
	if (update_focus) {
 | 
			
		||||
		struct view *view = server->active_view;
 | 
			
		||||
		if (!view || !view_is_always_on_top(view)) {
 | 
			
		||||
		if (!view || (!view->visible_on_all_workspaces
 | 
			
		||||
				&& !view_is_always_on_top(view))) {
 | 
			
		||||
			desktop_focus_topmost_view(server);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue