mirror of
https://github.com/swaywm/sway.git
synced 2026-04-06 07:15:44 -04:00
Use parse_boolean where possible.
This commit is contained in:
parent
7fa7f4f48d
commit
b865dabeba
11 changed files with 39 additions and 90 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include "sway/config.h"
|
||||
#include "sway/commands.h"
|
||||
#include "sway/input/input-manager.h"
|
||||
#include "util.h"
|
||||
|
||||
struct cmd_results *seat_cmd_fallback(int argc, char **argv) {
|
||||
struct cmd_results *error = NULL;
|
||||
|
|
@ -16,16 +17,8 @@ struct cmd_results *seat_cmd_fallback(int argc, char **argv) {
|
|||
}
|
||||
struct seat_config *new_config =
|
||||
new_seat_config(current_seat_config->name);
|
||||
|
||||
if (strcasecmp(argv[0], "true") == 0) {
|
||||
new_config->fallback = 1;
|
||||
} else if (strcasecmp(argv[0], "false") == 0) {
|
||||
new_config->fallback = 0;
|
||||
} else {
|
||||
free_seat_config(new_config);
|
||||
return cmd_results_new(CMD_INVALID, "fallback",
|
||||
"Expected 'fallback <true|false>'");
|
||||
}
|
||||
|
||||
new_config->fallback = parse_boolean(argv[0], false);
|
||||
|
||||
if (!config->validating) {
|
||||
apply_seat_config(new_config);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue