mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	Return success when renaming a workspace to itself
This commit is contained in:
		
							parent
							
								
									e726b5c445
								
							
						
					
					
						commit
						3a4f4f5d66
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
					@ -81,8 +81,12 @@ struct cmd_results *cmd_rename(int argc, char **argv) {
 | 
				
			||||||
	struct sway_workspace *tmp_workspace = workspace_by_name(new_name);
 | 
						struct sway_workspace *tmp_workspace = workspace_by_name(new_name);
 | 
				
			||||||
	if (tmp_workspace) {
 | 
						if (tmp_workspace) {
 | 
				
			||||||
		free(new_name);
 | 
							free(new_name);
 | 
				
			||||||
		return cmd_results_new(CMD_INVALID, "rename",
 | 
							if (tmp_workspace == workspace) {
 | 
				
			||||||
				"Workspace already exists");
 | 
								return cmd_results_new(CMD_SUCCESS, NULL, NULL);
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								return cmd_results_new(CMD_INVALID, "rename",
 | 
				
			||||||
 | 
										"Workspace already exists");
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	wlr_log(WLR_DEBUG, "renaming workspace '%s' to '%s'", workspace->name, new_name);
 | 
						wlr_log(WLR_DEBUG, "renaming workspace '%s' to '%s'", workspace->name, new_name);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue