diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-12-18 09:21:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-18 09:21:30 -0500 |
commit | eb4f66f7857d3e7cd8ac14a7fb43502fbc70de98 (patch) | |
tree | 7415bceb798fe498b0ab2d513736e0d7d06b5080 | |
parent | 4fea223aba96c743726d509fee58ec8d8ff4a3d3 (diff) | |
parent | c815d6d1a97fe940052f079bd8eb7f174f5ab004 (diff) |
Merge pull request #1526 from emersion/fractional-output-scale
Add support for fractional output scale
-rw-r--r-- | include/sway/config.h | 2 | ||||
-rw-r--r-- | sway/commands/output.c | 4 | ||||
-rw-r--r-- | sway/config/output.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/include/sway/config.h b/include/sway/config.h index 139d7800..afff2738 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -82,7 +82,7 @@ struct output_config { int width, height; float refresh_rate; int x, y; - int scale; + float scale; int32_t transform; char *background; diff --git a/sway/commands/output.c b/sway/commands/output.c index d71e4d8d..7988e3e4 100644 --- a/sway/commands/output.c +++ b/sway/commands/output.c @@ -144,7 +144,7 @@ struct cmd_results *cmd_output(int argc, char **argv) { goto fail; } char *end; - output->scale = strtol(argv[i], &end, 10); + output->scale = strtof(argv[i], &end); if (*end) { error = cmd_results_new(CMD_INVALID, "output", "Invalid scale."); @@ -278,7 +278,7 @@ struct cmd_results *cmd_output(int argc, char **argv) { } sway_log(L_DEBUG, "Config stored for output %s (enabled: %d) (%dx%d@%fHz " - "position %d,%d scale %d transform %d) (bg %s %s)", + "position %d,%d scale %f transform %d) (bg %s %s)", output->name, output->enabled, output->width, output->height, output->refresh_rate, output->x, output->y, output->scale, output->transform, output->background, output->background_option); diff --git a/sway/config/output.c b/sway/config/output.c index dc9ee37c..ff3f73a3 100644 --- a/sway/config/output.c +++ b/sway/config/output.c @@ -111,7 +111,7 @@ void apply_output_config(struct output_config *oc, swayc_t *output) { set_mode(wlr_output, oc->width, oc->height, oc->refresh_rate); } if (oc && oc->scale > 0) { - sway_log(L_DEBUG, "Set %s scale to %d", oc->name, oc->scale); + sway_log(L_DEBUG, "Set %s scale to %f", oc->name, oc->scale); wlr_output_set_scale(wlr_output, oc->scale); } if (oc && oc->transform >= 0) { |