From 81c67c368647f6efbcd55d2d77c095d738cc7c1c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 1 Nov 2018 00:07:24 +0100 Subject: [PATCH] Make wxDC::GetPPI() monitor-dependent in wxGTK3 Return the PPI for the display on which the associated window is shown and not the main display PPI. --- src/gtk/dc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gtk/dc.cpp b/src/gtk/dc.cpp index 3e7868173c..a41910ac32 100644 --- a/src/gtk/dc.cpp +++ b/src/gtk/dc.cpp @@ -15,6 +15,7 @@ #include "wx/dcclient.h" #include "wx/dcmemory.h" #include "wx/dcscreen.h" +#include "wx/display.h" #include "wx/gdicmn.h" #include "wx/icon.h" #include "wx/gtk/dc.h" @@ -238,7 +239,7 @@ wxSize wxGTKCairoDCImpl::GetPPI() const { if ( m_window ) { - return wxGetDisplayPPI(); + return wxDisplay(m_window).GetPPI(); } // For a non-window-based DC the concept of PPI doesn't make much sense