mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	commands/gaps: Check config->reading instead
Checking if the config is not active or is reloading is just a
convoluted way of checking if the config is being read.
(cherry picked from commit 861dde100a)
			
			
This commit is contained in:
		
							parent
							
								
									7f9baa05fa
								
							
						
					
					
						commit
						0299e0412a
					
				
					 1 changed files with 2 additions and 4 deletions
				
			
		| 
						 | 
					@ -215,15 +215,13 @@ struct cmd_results *cmd_gaps(int argc, char **argv) {
 | 
				
			||||||
		return error;
 | 
							return error;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	bool config_loading = !config->active || config->reloading;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (argc == 2) {
 | 
						if (argc == 2) {
 | 
				
			||||||
		return gaps_set_defaults(argc, argv);
 | 
							return gaps_set_defaults(argc, argv);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (argc == 4 && !config_loading) {
 | 
						if (argc == 4 && !config->reading) {
 | 
				
			||||||
		return gaps_set_runtime(argc, argv);
 | 
							return gaps_set_runtime(argc, argv);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (config_loading) {
 | 
						if (config->reading) {
 | 
				
			||||||
		return cmd_results_new(CMD_INVALID, "Expected %s", expected_defaults);
 | 
							return cmd_results_new(CMD_INVALID, "Expected %s", expected_defaults);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return cmd_results_new(CMD_INVALID, "Expected %s or %s",
 | 
						return cmd_results_new(CMD_INVALID, "Expected %s or %s",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue