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:
parent
8e817f8a0e
commit
4405176bb9
1 changed files with 1 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue