diff options
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sway/commands.c b/sway/commands.c index d572afa0..053b5792 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -1585,6 +1585,7 @@ static struct cmd_results *cmd_output(int argc, char **argv) { | |||
1585 | output->x = output->y = output->width = output->height = -1; | 1585 | output->x = output->y = output->width = output->height = -1; |
1586 | output->name = strdup(name); | 1586 | output->name = strdup(name); |
1587 | output->enabled = -1; | 1587 | output->enabled = -1; |
1588 | output->scale = 1; | ||
1588 | 1589 | ||
1589 | // TODO: atoi doesn't handle invalid numbers | 1590 | // TODO: atoi doesn't handle invalid numbers |
1590 | 1591 | ||
@@ -1642,6 +1643,11 @@ static struct cmd_results *cmd_output(int argc, char **argv) { | |||
1642 | } | 1643 | } |
1643 | output->x = x; | 1644 | output->x = x; |
1644 | output->y = y; | 1645 | output->y = y; |
1646 | } else if (strcasecmp(command, "scale") == 0) { | ||
1647 | if (++i >= argc) { | ||
1648 | return cmd_results_new(CMD_INVALID, "output", "Missing scale parameter."); | ||
1649 | } | ||
1650 | output->scale = atoi(argv[i]); | ||
1645 | } else if (strcasecmp(command, "background") == 0 || strcasecmp(command, "bg") == 0) { | 1651 | } else if (strcasecmp(command, "background") == 0 || strcasecmp(command, "bg") == 0) { |
1646 | wordexp_t p; | 1652 | wordexp_t p; |
1647 | if (++i >= argc) { | 1653 | if (++i >= argc) { |
@@ -1700,10 +1706,10 @@ static struct cmd_results *cmd_output(int argc, char **argv) { | |||
1700 | list_add(config->output_configs, output); | 1706 | list_add(config->output_configs, output); |
1701 | } | 1707 | } |
1702 | 1708 | ||
1703 | sway_log(L_DEBUG, "Config stored for output %s (enabled:%d) (%d x %d @ %d, %d) (bg %s %s)", | 1709 | sway_log(L_DEBUG, "Config stored for output %s (enabled:%d) (%d x %d @ %d, %d scale %d) (bg %s %s)", |
1704 | output->name, output->enabled, output->width, | 1710 | output->name, output->enabled, output->width, |
1705 | output->height, output->x, output->y, output->background, | 1711 | output->height, output->x, output->y, output->scale, |
1706 | output->background_option); | 1712 | output->background, output->background_option); |
1707 | 1713 | ||
1708 | if (output->name) { | 1714 | if (output->name) { |
1709 | // Try to find the output container and apply configuration now. If | 1715 | // Try to find the output container and apply configuration now. If |