mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	tree/workspace: Remove exclude arg from get_highest_available
workspace_output_get_highest_available took an output to exclude as argument, meant to avoid accidentally reselecting an output we are evacuating workspaces from. Outputs are now removed from the list before we evacuate, making exclusion unnecessary. Remove the argument.
This commit is contained in:
		
							parent
							
								
									005924f260
								
							
						
					
					
						commit
						534491d3aa
					
				
					 3 changed files with 4 additions and 8 deletions
				
			
		| 
						 | 
					@ -96,7 +96,7 @@ void workspace_output_add_priority(struct sway_workspace *workspace,
 | 
				
			||||||
		struct sway_output *output);
 | 
							struct sway_output *output);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct sway_output *workspace_output_get_highest_available(
 | 
					struct sway_output *workspace_output_get_highest_available(
 | 
				
			||||||
		struct sway_workspace *ws, struct sway_output *exclude);
 | 
							struct sway_workspace *ws);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void workspace_detect_urgent(struct sway_workspace *workspace);
 | 
					void workspace_detect_urgent(struct sway_workspace *workspace);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -37,7 +37,7 @@ static void restore_workspaces(struct sway_output *output) {
 | 
				
			||||||
		for (int j = 0; j < other->workspaces->length; j++) {
 | 
							for (int j = 0; j < other->workspaces->length; j++) {
 | 
				
			||||||
			struct sway_workspace *ws = other->workspaces->items[j];
 | 
								struct sway_workspace *ws = other->workspaces->items[j];
 | 
				
			||||||
			struct sway_output *highest =
 | 
								struct sway_output *highest =
 | 
				
			||||||
				workspace_output_get_highest_available(ws, NULL);
 | 
									workspace_output_get_highest_available(ws);
 | 
				
			||||||
			if (highest == output) {
 | 
								if (highest == output) {
 | 
				
			||||||
				workspace_detach(ws);
 | 
									workspace_detach(ws);
 | 
				
			||||||
				output_add_workspace(output, ws);
 | 
									output_add_workspace(output, ws);
 | 
				
			||||||
| 
						 | 
					@ -215,7 +215,7 @@ static void output_evacuate(struct sway_output *output) {
 | 
				
			||||||
		workspace_detach(workspace);
 | 
							workspace_detach(workspace);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		struct sway_output *new_output =
 | 
							struct sway_output *new_output =
 | 
				
			||||||
			workspace_output_get_highest_available(workspace, output);
 | 
								workspace_output_get_highest_available(workspace);
 | 
				
			||||||
		if (!new_output) {
 | 
							if (!new_output) {
 | 
				
			||||||
			new_output = fallback_output;
 | 
								new_output = fallback_output;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -659,13 +659,9 @@ void workspace_output_add_priority(struct sway_workspace *workspace,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct sway_output *workspace_output_get_highest_available(
 | 
					struct sway_output *workspace_output_get_highest_available(
 | 
				
			||||||
		struct sway_workspace *ws, struct sway_output *exclude) {
 | 
							struct sway_workspace *ws) {
 | 
				
			||||||
	for (int i = 0; i < ws->output_priority->length; i++) {
 | 
						for (int i = 0; i < ws->output_priority->length; i++) {
 | 
				
			||||||
		const char *name = ws->output_priority->items[i];
 | 
							const char *name = ws->output_priority->items[i];
 | 
				
			||||||
		if (exclude && output_match_name_or_id(exclude, name)) {
 | 
					 | 
				
			||||||
			continue;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		struct sway_output *output = output_by_name_or_id(name);
 | 
							struct sway_output *output = output_by_name_or_id(name);
 | 
				
			||||||
		if (output) {
 | 
							if (output) {
 | 
				
			||||||
			return output;
 | 
								return output;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue