Closed crsaracco closed 4 years ago
Hi,
What I get with get_screen_info.rates
seems completely erratic (thousands of fields, most of them are zero ?? could be a bug here...). This is not the right way to do.
Looking at the source of xrandr, the refresh rate is obtained from randr::get_screen_resources
, then modes
.
The actual rate is calculated by mode_refresh
I'm attempting to get the refresh rate of the screen, similar to the info that
xrandr
gives you.Here's what I have so far (not final API for what I'm doing, but good enough to post here):
That println gives me
[50]
, butxrandr
is giving me 60.00.Questions:
u16
s, instead of something like a float (thatxrandr
is giving me)xcb_randr_query_version
on my connection (major.minor >= 1.1) to get this to work right -- is this the case? I'm doing it as of right now, but I'm not sure if I'm doing it correctly. Also, what's a good major/minor to set here? Any good safe defaults for portability?randr_screen_info.rs
to show how to get this information?Thanks!