Implement GetDPIScaleFactor() more efficiently in wxGTK
Don't pass via wxDisplay, but use gtk_widget_get_scale_factor() (almost) directly instead.
This commit is contained in:
@@ -97,6 +97,7 @@ public:
|
|||||||
virtual int GetCharHeight() const wxOVERRIDE;
|
virtual int GetCharHeight() const wxOVERRIDE;
|
||||||
virtual int GetCharWidth() const wxOVERRIDE;
|
virtual int GetCharWidth() const wxOVERRIDE;
|
||||||
virtual double GetContentScaleFactor() const wxOVERRIDE;
|
virtual double GetContentScaleFactor() const wxOVERRIDE;
|
||||||
|
virtual double GetDPIScaleFactor() const wxOVERRIDE;
|
||||||
|
|
||||||
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
||||||
int range, bool refresh = true ) wxOVERRIDE;
|
int range, bool refresh = true ) wxOVERRIDE;
|
||||||
|
@@ -4363,6 +4363,13 @@ double wxWindowGTK::GetContentScaleFactor() const
|
|||||||
return scaleFactor;
|
return scaleFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double wxWindowGTK::GetDPIScaleFactor() const
|
||||||
|
{
|
||||||
|
// Under GTK 3 DPI scale factor is the same as content scale factor, while
|
||||||
|
// under GTK 2 both are always 1, so they're still the same.
|
||||||
|
return GetContentScaleFactor();
|
||||||
|
}
|
||||||
|
|
||||||
void wxWindowGTK::GTKDisableFocusOutEvent()
|
void wxWindowGTK::GTKDisableFocusOutEvent()
|
||||||
{
|
{
|
||||||
g_signal_handlers_block_by_func( m_focusWidget,
|
g_signal_handlers_block_by_func( m_focusWidget,
|
||||||
|
Reference in New Issue
Block a user