diff options
author | emersion <contact@emersion.fr> | 2017-12-27 21:23:30 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-12-27 21:23:30 +0100 |
commit | 21c61f1c0909b613471f18dd41e984c54540aca8 (patch) | |
tree | 9352fe3a49839c0e58fa34ad0f83f7b75970647f /sway/config/output.c | |
parent | Merge pull request #1535 from martinetd/libinput (diff) | |
download | sway-21c61f1c0909b613471f18dd41e984c54540aca8.tar.gz sway-21c61f1c0909b613471f18dd41e984c54540aca8.tar.zst sway-21c61f1c0909b613471f18dd41e984c54540aca8.zip |
Refactor output command, add output enable
Diffstat (limited to 'sway/config/output.c')
-rw-r--r-- | sway/config/output.c | 7 |
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) { | |||
14 | return strcmp(output->name, name); | 14 | return strcmp(output->name, name); |
15 | } | 15 | } |
16 | 16 | ||
17 | struct output_config *new_output_config() { | 17 | struct output_config *new_output_config(const char *name) { |
18 | struct output_config *oc = calloc(1, sizeof(struct output_config)); | 18 | struct output_config *oc = calloc(1, sizeof(struct output_config)); |
19 | if (oc == NULL) { | 19 | if (oc == NULL) { |
20 | return NULL; | 20 | return NULL; |
21 | } | 21 | } |
22 | oc->name = strdup(name); | ||
23 | if (oc->name == NULL) { | ||
24 | free(oc); | ||
25 | return NULL; | ||
26 | } | ||
22 | oc->enabled = -1; | 27 | oc->enabled = -1; |
23 | oc->width = oc->height = -1; | 28 | oc->width = oc->height = -1; |
24 | oc->refresh_rate = -1; | 29 | oc->refresh_rate = -1; |