aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorDanilo Spinella <danyspin97@protonmail.com>2019-10-20 23:10:39 +0200
committerSimon Ser <contact@emersion.fr>2019-10-21 14:22:20 +0200
commita5b6f40937a1f7630ec484bd2485b0b0f5f91c20 (patch)
tree84554982c63372dfb097c9dcbc24572b9cd9e1ed /sway
parent3ee3a9ef60c6259720564bbedb0c74d545d2ec53 (diff)
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')
-rw-r--r--sway/config/output.c4
-rw-r--r--sway/desktop/output.c2
2 files changed, 3 insertions, 3 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) {
bool modeset_success;
if (oc && oc->width > 0 && oc->height > 0) {
- sway_log(SWAY_DEBUG, "Set %s mode to %dx%d (%f GHz)", oc->name, oc->width,
+ sway_log(SWAY_DEBUG, "Set %s mode to %dx%d (%f Hz)", oc->name, oc->width,
oc->height, oc->refresh_rate);
modeset_success =
set_mode(wlr_output, oc->width, oc->height, oc->refresh_rate);
@@ -329,7 +329,7 @@ static void default_output_config(struct output_config *oc,
wl_container_of(wlr_output->modes.prev, mode, link);
oc->width = mode->width;
oc->height = mode->height;
- oc->refresh_rate = mode->refresh;
+ oc->refresh_rate = mode->refresh / 1000.f;
}
oc->x = oc->y = -1;
oc->scale = 1;
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 36e406c3..42194d54 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -856,7 +856,7 @@ void handle_output_manager_apply(struct wl_listener *listener, void *data) {
struct wlr_output_mode *mode = config_head->state.mode;
oc->width = mode->width;
oc->height = mode->height;
- oc->refresh_rate = mode->refresh;
+ oc->refresh_rate = mode->refresh / 1000.f;
} else {
oc->width = config_head->state.custom_mode.width;
oc->height = config_head->state.custom_mode.height;