Fixed monitor size not corrected for rotation.

Fixes #413.
This commit is contained in:
Camilla Berglund
2015-01-08 03:56:12 +01:00
parent 4329a78011
commit bb338a2b9c
2 changed files with 14 additions and 4 deletions
+12 -3
View File
@@ -224,6 +224,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
for (j = 0; j < ci->noutput; j++)
{
int widthMM, heightMM;
XRROutputInfo* oi = XRRGetOutputInfo(_glfw.x11.display,
sr, ci->outputs[j]);
if (oi->connection != RR_Connected)
@@ -238,10 +239,18 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
monitors = realloc(monitors, sizeof(_GLFWmonitor*) * size);
}
monitors[found] = _glfwAllocMonitor(oi->name,
oi->mm_width,
oi->mm_height);
if (ci->rotation == RR_Rotate_90 || ci->rotation == RR_Rotate_270)
{
widthMM = oi->mm_height;
heightMM = oi->mm_width;
}
else
{
widthMM = oi->mm_width;
heightMM = oi->mm_height;
}
monitors[found] = _glfwAllocMonitor(oi->name, widthMM, heightMM);
monitors[found]->x11.output = ci->outputs[j];
monitors[found]->x11.crtc = oi->crtc;