mirror of
https://github.com/swaywm/sway.git
synced 2025-11-25 06:59:48 -05:00
Refactor output command, add output enable
This commit is contained in:
parent
e1c5adc918
commit
21c61f1c09
3 changed files with 231 additions and 219 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue