-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2286 from RyanDwyer/default-floating-border
Implement default_floating_border command and adjust CSD behaviour
- Loading branch information
Showing
7 changed files
with
72 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "log.h" | ||
#include "sway/commands.h" | ||
#include "sway/config.h" | ||
#include "sway/tree/container.h" | ||
|
||
struct cmd_results *cmd_default_floating_border(int argc, char **argv) { | ||
struct cmd_results *error = NULL; | ||
if ((error = checkarg(argc, "default_floating_border", | ||
EXPECTED_AT_LEAST, 1))) { | ||
return error; | ||
} | ||
|
||
if (strcmp(argv[0], "none") == 0) { | ||
config->floating_border = B_NONE; | ||
} else if (strcmp(argv[0], "normal") == 0) { | ||
config->floating_border = B_NORMAL; | ||
} else if (strcmp(argv[0], "pixel") == 0) { | ||
config->floating_border = B_PIXEL; | ||
} else { | ||
return cmd_results_new(CMD_INVALID, "default_floating_border", | ||
"Expected 'default_floating_border <none|normal|pixel>' " | ||
"or 'default_floating_border <normal|pixel> <px>'"); | ||
} | ||
if (argc == 2) { | ||
config->floating_border_thickness = atoi(argv[1]); | ||
} | ||
|
||
return cmd_results_new(CMD_SUCCESS, NULL, NULL); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters