Merge pull request #518 from proski/randr

Provide reasonable hTotal, vTotal and dotClock for the display mode
This commit is contained in:
metalefty 2016-12-03 20:24:10 +09:00 committed by GitHub
commit 42d370fcdd

View File

@ -321,11 +321,15 @@ rdpRRAddOutput(const char *aname, int x, int y, int width, int height)
RROutputPtr output; RROutputPtr output;
xRRModeInfo modeInfo; xRRModeInfo modeInfo;
char name[64]; char name[64];
const int vfreq = 50;
sprintf (name, "%dx%d", width, height); sprintf (name, "%dx%d", width, height);
memset (&modeInfo, 0, sizeof(modeInfo)); memset (&modeInfo, 0, sizeof(modeInfo));
modeInfo.width = width; modeInfo.width = width;
modeInfo.height = height; modeInfo.height = height;
modeInfo.hTotal = width;
modeInfo.vTotal = height;
modeInfo.dotClock = vfreq * width * height;
modeInfo.nameLength = strlen(name); modeInfo.nameLength = strlen(name);
mode = RRModeGet(&modeInfo, name); mode = RRModeGet(&modeInfo, name);
if (mode == 0) if (mode == 0)