1
0
mirror of https://github.com/emersion/wlr-randr synced 2024-11-26 07:33:46 +01:00

Fix mode refresh rounding issue

Fix mode not being found when setting mode, even when copied and
pasted from mode list.
This commit is contained in:
Jordan Leppert 2020-12-31 17:47:37 +00:00 committed by Simon Ser
parent 988a802f5b
commit 1cc82e6950
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
2 changed files with 5 additions and 2 deletions

3
main.c

@ -2,6 +2,7 @@
#include <assert.h>
#include <errno.h>
#include <getopt.h>
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@ -429,7 +430,7 @@ static bool parse_mode(const char *value, int *width, int *height,
return false;
}
*refresh = refresh_hz * 1000; // Hz → mHz
*refresh = round(refresh_hz * 1000); // Hz → mHz
}
}

@ -36,11 +36,13 @@ add_project_arguments(cc.get_supported_arguments([
wayland_client = dependency('wayland-client')
math = cc.find_library('m', required: false)
subdir('protocol')
wlr_randr_exe = executable(
meson.project_name(),
files(['main.c']),
dependencies: [wayland_client, client_protos],
dependencies: [wayland_client, client_protos, math],
install: true,
)