aboutsummaryrefslogtreecommitdiffstats
path: root/sway/config
diff options
context:
space:
mode:
authorLibravatar Danilo Spinella <danyspin97@protonmail.com>2019-10-20 23:10:39 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2019-10-21 14:22:20 +0200
commita5b6f40937a1f7630ec484bd2485b0b0f5f91c20 (patch)
tree84554982c63372dfb097c9dcbc24572b9cd9e1ed /sway/config
parentfocus: support focus_wrapping workspace (diff)
downloadsway-a5b6f40937a1f7630ec484bd2485b0b0f5f91c20.tar.gz
sway-a5b6f40937a1f7630ec484bd2485b0b0f5f91c20.tar.zst
sway-a5b6f40937a1f7630ec484bd2485b0b0f5f91c20.zip
Fix refresh rate scale of output
When applying config, value mode->refresh is mHz; convert it to Hz before assigning it to the temporary output config. oc->refresh_rate will be converted back to mHz in set_mode function. Fix debug log printing GHz instead of Hz.
Diffstat (limited to 'sway/config')
-rw-r--r--sway/config/output.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/config/output.c b/sway/config/output.c
index 9da009bb..12a875b7 100644
--- a/sway/config/output.c
+++ b/sway/config/output.c
@@ -260,7 +260,7 @@ bool apply_output_config(struct output_config *oc, struct sway_output *output) {
260 260
261 bool modeset_success; 261 bool modeset_success;
262 if (oc && oc->width > 0 && oc->height > 0) { 262 if (oc && oc->width > 0 && oc->height > 0) {
263 sway_log(SWAY_DEBUG, "Set %s mode to %dx%d (%f GHz)", oc->name, oc->width, 263 sway_log(SWAY_DEBUG, "Set %s mode to %dx%d (%f Hz)", oc->name, oc->width,
264 oc->height, oc->refresh_rate); 264 oc->height, oc->refresh_rate);
265 modeset_success = 265 modeset_success =
266 set_mode(wlr_output, oc->width, oc->height, oc->refresh_rate); 266 set_mode(wlr_output, oc->width, oc->height, oc->refresh_rate);
@@ -329,7 +329,7 @@ static void default_output_config(struct output_config *oc,
329 wl_container_of(wlr_output->modes.prev, mode, link); 329 wl_container_of(wlr_output->modes.prev, mode, link);
330 oc->width = mode->width; 330 oc->width = mode->width;
331 oc->height = mode->height; 331 oc->height = mode->height;
332 oc->refresh_rate = mode->refresh; 332 oc->refresh_rate = mode->refresh / 1000.f;
333 } 333 }
334 oc->x = oc->y = -1; 334 oc->x = oc->y = -1;
335 oc->scale = 1; 335 oc->scale = 1;