[evince/gnome-3-38] presentation mode: fix X11 regression



commit 362f1dac392d14c02978f0116ddd6bd3c988f80b
Author: Nelson Benítez León <nbenitezl gmail com>
Date:   Wed Oct 21 01:00:08 2020 -0400

    presentation mode: fix X11 regression
    
    caused by my commit b2b9012c5e because
    it added a wayland fix without ensuring
    it'll be used in Wayland only.
    
    Fixes #1504

 libview/ev-view-presentation.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c
index 95963592..43887442 100644
--- a/libview/ev-view-presentation.c
+++ b/libview/ev-view-presentation.c
@@ -30,6 +30,9 @@
 #include "ev-transition-animation.h"
 #include "ev-view-cursor.h"
 #include "ev-page-cache.h"
+#ifdef GDK_WINDOWING_WAYLAND
+#include <gdk/gdkwayland.h>
+#endif
 
 enum {
        PROP_0,
@@ -1287,14 +1290,16 @@ 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;
+
+#if GTK_CHECK_VERSION(3, 24, 9) && defined (GDK_WINDOWING_WAYLAND)
+       if (GDK_IS_WAYLAND_DISPLAY (display)) {
+               /* 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;
+       }
 #endif
 }
 


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