[MAC] Incorrect resolution with mirrored displays patch
#1
Hi!

This is my first patch :-)

Ticket: http://trac.xbmc.org/ticket/8407

Description:
If monitors in a mirrored set have different native resolutions, CGDisplayCurrentMode can return incorrect resolution data (the larger displays native resolution instead of the actual resolution). I have replaced calls to CGDisplayCurrentMode with CGDisplayPixelsWide and CGDisplayPixelsHigh which do not have this issue.

Background:
My setup is an iMac 24" with an external display connected. I use display mirroring. The iMac has a native resolution of 1920x1200 and the external display is 1920x1080. The actual resolution used when mirroring is 1920x1080. In this case CGDisplayCurrentMode returns the iMacs native resolution instead of the actual resolution. The result is of course that XBMC thinks the resolution is 1920x1200 when it in fact is 1920x1080. As a result there are draw issues.

Additionally: CGDisplayCurrentMode is deprecated in 10.6. I have not found a way to get the screen refresh rate without it though so those calls are still in the code.
Reply
#2
Thanks, I'll apply once I verify under a multi-display setup.
Reply
#3
Thanks! Let me know if you need any more info to reproduce it.
Reply
#4
I see that my description of the problem could use some clarification:

When this occurs the iMac is set to 1920x1200 and the external display is set to 1920x1080. The image on the iMac is letterboxed, that is, it has black bars above and below the active display area which is 1920x1080 and it draws "pixelperfect" without scaling. In this case the display preferences indicates that the resolution for the iMac display is 1920x1200 but the "useable resolution" is 1920x1080. Please see my screenshot attached to the ticket for how this looks.

So to reproduce, make sure your external display is set to 1920x1080 and your main/internal display is set to something else, preferable larger. Then verify in the display preferences that the set resolution is not the same as the "useable resolution" as in the screenshot.

I'm not sure if this is something special for the iMac due to it having a 16:10 display ratio and the external display has a 16:9 display ratio and that Apple did not want to distort the proportions by scaling?

I hope this helps clarify it. Otherwise let me know. :-)
Reply
#5
@spaltzer, I've seen it happen not just on iMacs but on any mac with a display. Any scenario where you have mac with a display and an external monitor with different native resolutions will have this glitch when mirroring displays.
Reply
#6
Thanks pdukes. That's good to know.
Reply

Logout Mark Read Team Forum Stats Members Help
[MAC] Incorrect resolution with mirrored displays patch0