[evince/BUG_presentation_too_large_on_scaled_display: 9/9] presentation: fix too large slides on scaled display



commit b2b9012c5e326f08a2347441c6a88b28b60a9f02
Author: Nelson Benítez León <nbenitezl gmail com>
Date:   Fri Apr 10 13:27:06 2020 -0400

    presentation: fix too large slides on scaled display
    
    which happens due to GTK regression in the reported
    sizes obtained from gdk_monitor_get_geometry()
    function which changed behaviour starting with
    GTK 3.24.9. See gtk#2599 .
    
    Fixes #1365

 libview/ev-view-presentation.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c
index 8f22c0f1..228ecc14 100644
--- a/libview/ev-view-presentation.c
+++ b/libview/ev-view-presentation.c
@@ -1287,8 +1287,15 @@ ev_view_presentation_update_monitor_geometry (EvViewPresentation *pview)
        monitor = gdk_display_get_monitor_at_window (display, window);
        gdk_monitor_get_geometry (monitor, &geometry);
 
+#if GTK_CHECK_VERSION(3, 24, 9)
+       /* See Evince issue #1365 and GTK regression gtk#2599 */
+       int scale_factor = gdk_monitor_get_scale_factor (monitor);
+       pview->monitor_width = geometry.width / scale_factor;
+       pview->monitor_height = geometry.height / scale_factor;
+#else
        pview->monitor_width = geometry.width;
        pview->monitor_height = geometry.height;
+#endif
 }
 
 static gboolean


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]