From 1938adb5dc3d0593210c774cfaae09ca5a3b3fd3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 29 Oct 2018 17:50:56 +0100 Subject: [PATCH] Don't use gdk_screen_xxx_mm() with multiple displays These functions combine the sizes of all displays and so only return the correct size when there is only a single display. This fixes wildly wrong PPI values returned when more than one display is used. --- src/gtk/display.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gtk/display.cpp b/src/gtk/display.cpp index b5eedeab71..281901cc70 100644 --- a/src/gtk/display.cpp +++ b/src/gtk/display.cpp @@ -317,7 +317,7 @@ wxSize wxDisplayImplGTK::GetSizeMM() const // At least in some configurations, gdk_screen_xxx_mm() functions return // valid values when gdk_screen_get_monitor_xxx_mm() only return -1, so // handle this case specially. - if ( IsPrimary() ) + if ( gdk_screen_get_n_monitors(m_screen) == 1 ) { return wxSize(gdk_screen_width_mm(), gdk_screen_height_mm()); }