[gtk: 1/2] hidpi: Rescan monitors when screen scale factor changes



commit 23211bcae810f8d246d37924e689afdfd1a88855
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Feb 10 15:19:32 2020 +0100

    hidpi: Rescan monitors when screen scale factor changes
    
    All the code in e.g. init_randr15() divides the physical resolutions with
    the screen scale, however if we get the screen scale from xsettings
    rather than e.g. GDK_SCALE the initial setup is using the wrong value.
    
    So, whenever the screen scale size is changed we need to trigger
    a re-read of the randr data

 gdk/x11/gdkscreen-x11.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
index 838a6d1cf1..b99972a029 100644
--- a/gdk/x11/gdkscreen-x11.c
+++ b/gdk/x11/gdkscreen-x11.c
@@ -49,6 +49,7 @@
 static void gdk_x11_screen_dispose  (GObject      *object);
 static void gdk_x11_screen_finalize (GObject      *object);
 static void init_randr_support     (GdkX11Screen *screen);
+static void process_monitors_change (GdkX11Screen *screen);
 
 enum
 {
@@ -963,6 +964,9 @@ _gdk_x11_screen_set_surface_scale (GdkX11Screen *x11_screen,
 
       gdk_monitor_set_scale_factor (monitor, scale);
     }
+
+  /* We re-read the monitor sizes so we can apply the new scale */
+  process_monitors_change (x11_screen);
 }
 
 static void


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