Implement wxGetDisplaySizeMM() correctly in wxOSX

Return the real screen size instead of hard-coding 72 DPI.

Closes #17614.
This commit is contained in:
David Vanderson
2016-08-08 14:00:07 +02:00
committed by Vadim Zeitlin
parent e300f28976
commit 49801e57f1
2 changed files with 6 additions and 9 deletions

View File

@@ -120,6 +120,7 @@ wxMSW:
wxOSX:
- Fix handling of non-BMP characters in GetPartialTextExtents() (ARATA Mizuki).
- Implement wxGetDisplaySizeMM() correctly (David Vanderson).
- Remove extra borders around wxFilePickerCtrl (John Roberts).
- Set up extensions filter correctly in wxFileDialog (nick863).
- Turn off automatic quotes substitutions in wxTextCtrl (Xlord2).

View File

@@ -157,15 +157,11 @@ bool wxDoLaunchDefaultBrowser(const wxLaunchBrowserParams& params)
void wxDisplaySizeMM(int *width, int *height)
{
wxDisplaySize(width, height);
// on mac 72 is fixed (at least now;-)
double cvPt2Mm = 25.4 / 72;
if (width != NULL)
*width = int( *width * cvPt2Mm );
if (height != NULL)
*height = int( *height * cvPt2Mm );
CGSize size = CGDisplayScreenSize(CGMainDisplayID());
if ( width )
*width = (int)size.width ;
if ( height )
*height = (int)size.height;
}