mirror of
https://github.com/NickHu/sway
synced 2024-12-28 22:23:30 +01:00
Don't allow negative gaps
This commit is contained in:
parent
415a48ac63
commit
bb708d0f82
1 changed files with 6 additions and 0 deletions
|
@ -68,6 +68,9 @@ static struct cmd_results *gaps_set_defaults(int argc, char **argv) {
|
|||
return cmd_results_new(CMD_INVALID, "gaps",
|
||||
"Expected 'gaps inner|outer <px>'");
|
||||
}
|
||||
if (amount < 0) {
|
||||
amount = 0;
|
||||
}
|
||||
|
||||
if (inner) {
|
||||
config->gaps_inner = amount;
|
||||
|
@ -92,6 +95,9 @@ static void configure_gaps(struct sway_workspace *ws, void *_data) {
|
|||
*prop -= data->amount;
|
||||
break;
|
||||
}
|
||||
if (*prop < 0) {
|
||||
*prop = 0;
|
||||
}
|
||||
arrange_workspace(ws);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue