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

View File

@ -157,7 +157,8 @@ GLFW bundles a number of dependencies in the `deps/` directory.
- [X11] Bugfix: Window frame interactions were reported as focus events - [X11] Bugfix: Window frame interactions were reported as focus events
- [X11] Bugfix: Workaround for legacy Compiz caused flickering during resize - [X11] Bugfix: Workaround for legacy Compiz caused flickering during resize
- [X11] Bugfix: The name pointer of joysticks were not cleared on disconnection - [X11] Bugfix: The name pointer of joysticks were not cleared on disconnection
- [X11] Bugfix: Video mode dimensions were not rotated to match the CRTC - [X11] Bugfix: Video mode resolutions and monitor physical sizes were not
corrected for rotated CRTCs
- [X11] Bugfix: Unicode character input ignored dead keys - [X11] Bugfix: Unicode character input ignored dead keys
- [X11] Bugfix: X-axis scroll offsets were inverted - [X11] Bugfix: X-axis scroll offsets were inverted
- [X11] Bugfix: Full screen override redirect windows were not always - [X11] Bugfix: Full screen override redirect windows were not always

View File

@ -224,6 +224,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
for (j = 0; j < ci->noutput; j++) for (j = 0; j < ci->noutput; j++)
{ {
int widthMM, heightMM;
XRROutputInfo* oi = XRRGetOutputInfo(_glfw.x11.display, XRROutputInfo* oi = XRRGetOutputInfo(_glfw.x11.display,
sr, ci->outputs[j]); sr, ci->outputs[j]);
if (oi->connection != RR_Connected) if (oi->connection != RR_Connected)
@ -238,10 +239,18 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
monitors = realloc(monitors, sizeof(_GLFWmonitor*) * size); monitors = realloc(monitors, sizeof(_GLFWmonitor*) * size);
} }
monitors[found] = _glfwAllocMonitor(oi->name, if (ci->rotation == RR_Rotate_90 || ci->rotation == RR_Rotate_270)
oi->mm_width, {
oi->mm_height); 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.output = ci->outputs[j];
monitors[found]->x11.crtc = oi->crtc; monitors[found]->x11.crtc = oi->crtc;