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: wxOSX:
- Fix handling of non-BMP characters in GetPartialTextExtents() (ARATA Mizuki). - Fix handling of non-BMP characters in GetPartialTextExtents() (ARATA Mizuki).
- Implement wxGetDisplaySizeMM() correctly (David Vanderson).
- Remove extra borders around wxFilePickerCtrl (John Roberts). - Remove extra borders around wxFilePickerCtrl (John Roberts).
- Set up extensions filter correctly in wxFileDialog (nick863). - Set up extensions filter correctly in wxFileDialog (nick863).
- Turn off automatic quotes substitutions in wxTextCtrl (Xlord2). - 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) void wxDisplaySizeMM(int *width, int *height)
{ {
wxDisplaySize(width, height); CGSize size = CGDisplayScreenSize(CGMainDisplayID());
// on mac 72 is fixed (at least now;-) if ( width )
double cvPt2Mm = 25.4 / 72; *width = (int)size.width ;
if ( height )
if (width != NULL) *height = (int)size.height;
*width = int( *width * cvPt2Mm );
if (height != NULL)
*height = int( *height * cvPt2Mm );
} }