aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2017-12-18 09:21:30 -0500
committerLibravatar GitHub <noreply@github.com>2017-12-18 09:21:30 -0500
commiteb4f66f7857d3e7cd8ac14a7fb43502fbc70de98 (patch)
tree7415bceb798fe498b0ab2d513736e0d7d06b5080 /sway
parentMerge pull request #1525 from emersion/ipc-get-outputs (diff)
parentAdd support for fractional output scale (diff)
downloadsway-eb4f66f7857d3e7cd8ac14a7fb43502fbc70de98.tar.gz
sway-eb4f66f7857d3e7cd8ac14a7fb43502fbc70de98.tar.zst
sway-eb4f66f7857d3e7cd8ac14a7fb43502fbc70de98.zip
Merge pull request #1526 from emersion/fractional-output-scale
Add support for fractional output scale
Diffstat (limited to 'sway')
-rw-r--r--sway/commands/output.c4
-rw-r--r--sway/config/output.c2
2 files changed, 3 insertions, 3 deletions
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) {
144 goto fail; 144 goto fail;
145 } 145 }
146 char *end; 146 char *end;
147 output->scale = strtol(argv[i], &end, 10); 147 output->scale = strtof(argv[i], &end);
148 if (*end) { 148 if (*end) {
149 error = cmd_results_new(CMD_INVALID, "output", 149 error = cmd_results_new(CMD_INVALID, "output",
150 "Invalid scale."); 150 "Invalid scale.");
@@ -278,7 +278,7 @@ struct cmd_results *cmd_output(int argc, char **argv) {
278 } 278 }
279 279
280 sway_log(L_DEBUG, "Config stored for output %s (enabled: %d) (%dx%d@%fHz " 280 sway_log(L_DEBUG, "Config stored for output %s (enabled: %d) (%dx%d@%fHz "
281 "position %d,%d scale %d transform %d) (bg %s %s)", 281 "position %d,%d scale %f transform %d) (bg %s %s)",
282 output->name, output->enabled, output->width, output->height, 282 output->name, output->enabled, output->width, output->height,
283 output->refresh_rate, output->x, output->y, output->scale, 283 output->refresh_rate, output->x, output->y, output->scale,
284 output->transform, output->background, output->background_option); 284 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) {
111 set_mode(wlr_output, oc->width, oc->height, oc->refresh_rate); 111 set_mode(wlr_output, oc->width, oc->height, oc->refresh_rate);
112 } 112 }
113 if (oc && oc->scale > 0) { 113 if (oc && oc->scale > 0) {
114 sway_log(L_DEBUG, "Set %s scale to %d", oc->name, oc->scale); 114 sway_log(L_DEBUG, "Set %s scale to %f", oc->name, oc->scale);
115 wlr_output_set_scale(wlr_output, oc->scale); 115 wlr_output_set_scale(wlr_output, oc->scale);
116 } 116 }
117 if (oc && oc->transform >= 0) { 117 if (oc && oc->transform >= 0) {