Return correct scale factor for not yet realized windows in wxGTK

wxWindow::GetContentScaleFactor() always returned 1 before the window
was shown in wxGTK, which was rather annoying as typically icons are
initialized on application startup, i.e. before showing the windows, and
so the wrong scale factor was silently used for them.
This commit is contained in:
Vadim Zeitlin
2018-10-31 20:42:10 +01:00
committed by paulcor
parent 8e817f8a0e
commit 4405176bb9

View File

@@ -4314,9 +4314,7 @@ double wxWindowGTK::GetContentScaleFactor() const
#if GTK_CHECK_VERSION(3,10,0)
if (m_widget && gtk_check_version(3,10,0) == NULL)
{
GdkWindow* window = gtk_widget_get_window(m_widget);
if (window)
scaleFactor = gdk_window_get_scale_factor(window);
scaleFactor = gtk_widget_get_scale_factor(m_widget);
}
#endif
return scaleFactor;