aboutsummaryrefslogtreecommitdiff
path: root/sway/config
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-12-27 12:44:03 -0800
committerGitHub <noreply@github.com>2017-12-27 12:44:03 -0800
commit60ac3f2e82f5d92bd6258728f7ad40be2997baef (patch)
tree9352fe3a49839c0e58fa34ad0f83f7b75970647f /sway/config
parente1c5adc918a95209b432b89a75114e2cd20412a4 (diff)
parent21c61f1c0909b613471f18dd41e984c54540aca8 (diff)
Merge pull request #1540 from emersion/output-command-refactor
Refactor output command, add output enable
Diffstat (limited to 'sway/config')
-rw-r--r--sway/config/output.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sway/config/output.c b/sway/config/output.c
index ff3f73a3..f336c949 100644
--- a/sway/config/output.c
+++ b/sway/config/output.c
@@ -14,11 +14,16 @@ int output_name_cmp(const void *item, const void *data) {
return strcmp(output->name, name);
}
-struct output_config *new_output_config() {
+struct output_config *new_output_config(const char *name) {
struct output_config *oc = calloc(1, sizeof(struct output_config));
if (oc == NULL) {
return NULL;
}
+ oc->name = strdup(name);
+ if (oc->name == NULL) {
+ free(oc);
+ return NULL;
+ }
oc->enabled = -1;
oc->width = oc->height = -1;
oc->refresh_rate = -1;