mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Destroy empty workspaces in output_evacuate
This commit is contained in:
		
							parent
							
								
									d6a5dfc913
								
							
						
					
					
						commit
						148b113b8d
					
				
					 1 changed files with 7 additions and 2 deletions
				
			
		| 
						 | 
					@ -128,14 +128,19 @@ static void output_evacuate(struct sway_container *output) {
 | 
				
			||||||
	while (output->children->length) {
 | 
						while (output->children->length) {
 | 
				
			||||||
		struct sway_container *workspace = output->children->items[0];
 | 
							struct sway_container *workspace = output->children->items[0];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							container_remove_child(workspace);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (workspace_is_empty(workspace)) {
 | 
				
			||||||
 | 
								workspace_begin_destroy(workspace);
 | 
				
			||||||
 | 
								continue;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		struct sway_container *new_output =
 | 
							struct sway_container *new_output =
 | 
				
			||||||
			workspace_output_get_highest_available(workspace, output);
 | 
								workspace_output_get_highest_available(workspace, output);
 | 
				
			||||||
		if (!new_output) {
 | 
							if (!new_output) {
 | 
				
			||||||
			new_output = fallback_output;
 | 
								new_output = fallback_output;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		container_remove_child(workspace);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if (new_output) {
 | 
							if (new_output) {
 | 
				
			||||||
			workspace_output_add_priority(workspace, new_output);
 | 
								workspace_output_add_priority(workspace, new_output);
 | 
				
			||||||
			container_add_child(new_output, workspace);
 | 
								container_add_child(new_output, workspace);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue