diff --git a/include/wx/gtk/window.h b/include/wx/gtk/window.h index 9ca1202da1..9ec33b88ab 100644 --- a/include/wx/gtk/window.h +++ b/include/wx/gtk/window.h @@ -97,6 +97,7 @@ public: virtual int GetCharHeight() const wxOVERRIDE; virtual int GetCharWidth() const wxOVERRIDE; virtual double GetContentScaleFactor() const wxOVERRIDE; + virtual double GetDPIScaleFactor() const wxOVERRIDE; virtual void SetScrollbar( int orient, int pos, int thumbVisible, int range, bool refresh = true ) wxOVERRIDE; diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 4e33c1ff06..e7c8ecbe39 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -4363,6 +4363,13 @@ double wxWindowGTK::GetContentScaleFactor() const 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() { g_signal_handlers_block_by_func( m_focusWidget,