re.mcclue
2021-03-27 11:35:56 UTC
A XRRScreenResources contains multiple XRRModeInfo and RROutput (which with XRRGetOutputInfo() effectively means XRROutputInfo). Therefore, a screen can have many outputs which in turn, can have many modes. I can restrict myself to only (XRROutputInfo *)->connection == RR_Connected outputs, however this still leaves many possible modes. The, rate is a property of the mode. Because of this many-to-many relationship, how can I determine what the active rate is?
In other words:
XRRScreenResources *res = XRRGetScreenResources(display, default_root_window);
for (int i = 0; i < res->nmode; ++i) {
XRRModeInfo *mode_info = &res->modes[i];
// How do you verify this is the active rate?
double rate = (double)mode_info->dotClock / ((double)mode_info->hTotal * (double)mode_info->vTotal));
}
Sent with [ProtonMail](https://protonmail.com) Secure Email.
Sent with [ProtonMail](https://protonmail.com) Secure Email.
In other words:
XRRScreenResources *res = XRRGetScreenResources(display, default_root_window);
for (int i = 0; i < res->nmode; ++i) {
XRRModeInfo *mode_info = &res->modes[i];
// How do you verify this is the active rate?
double rate = (double)mode_info->dotClock / ((double)mode_info->hTotal * (double)mode_info->vTotal));
}
Sent with [ProtonMail](https://protonmail.com) Secure Email.
Sent with [ProtonMail](https://protonmail.com) Secure Email.