From 4405176bb978a46ec8b03378e87d02d690e0ca1c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 31 Oct 2018 20:42:10 +0100 Subject: [PATCH] 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. --- src/gtk/window.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 64a633afaf..e440422ab7 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -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;