[gtk/wip/nacho/quartz-scale-factor] quartz/display: add back scaling factor



commit 1a9377bab91657bea88ea8e3a502e8a41648e9a8
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Tue Dec 18 11:33:16 2018 +0100

    quartz/display: add back scaling factor
    
    With the last patches one thing that got lost if the scaling
    factor. This is very visible when i.e loading a svg image
    in a Retina display.

 gdk/quartz/gdkdisplay-quartz.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gdk/quartz/gdkdisplay-quartz.c b/gdk/quartz/gdkdisplay-quartz.c
index a342b88ff2..165e92bf09 100644
--- a/gdk/quartz/gdkdisplay-quartz.c
+++ b/gdk/quartz/gdkdisplay-quartz.c
@@ -252,7 +252,12 @@ configure_monitor (GdkMonitor *monitor)
   monitor->width_mm = width;
   monitor->height_mm = height;
   monitor->geometry = disp_geometry;
-  monitor->scale_factor = 1;
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
+  if (gdk_quartz_osx_version () >= GDK_OSX_MOUNTAIN_LION)
+    monitor->scale_factor = CGDisplayModeGetPixelWidth (mode) / CGDisplayModeGetWidth (mode);
+  else
+#endif
+    monitor->scale_factor = 1;
   monitor->refresh_rate = refresh_rate;
   monitor->subpixel_layout = GDK_SUBPIXEL_LAYOUT_UNKNOWN;
   CGDisplayModeRelease (mode);


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