Return "logical" PPI from wxDisplay::GetPPI() in wxGTK3

Just scale the standard PPI by the scaling factor instead of trying to
compute the actual physical PPI, as the latter is not useful and is
incompatible with the value used by all the other applications.
This commit is contained in:
Vadim Zeitlin
2020-08-06 23:58:05 +02:00
parent 52b25211c8
commit e902050002

View File

@@ -350,7 +350,17 @@ double wxDisplayImplGTK::GetScaleFactor() const
return 1.0;
}
#endif // GTK+ 3.10
wxSize wxDisplayImplGTK::GetPPI() const
{
// The useful value of PPI is the scaled value of the default PPI and not
// the actual PPI computed by dividing the number of pixels by the physical
// screen size: this is what everyone else uses, and so we should do it
// too.
return wxDisplay::GetStdPPI()*GetScaleFactor();
}
#else // GTK+ < 3.10
wxSize wxDisplayImplGTK::GetPPI() const
{
@@ -370,6 +380,8 @@ wxSize wxDisplayImplGTK::GetPPI() const
return ppi;
}
#endif // GTK+ 3.10
wxSize wxDisplayImplGTK::GetSizeMM() const
{
wxSize sizeMM;