[Xfce4-commits] [xfce/xfwm4] 01/01: common: Convert monitor geometry to device geometry

noreply at xfce.org noreply at xfce.org
Tue Jul 31 11:30:59 CEST 2018


This is an automated email from the git hooks/post-receive script.

o   l   i   v   i   e   r       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfwm4.

commit be929b2ad13a9a8ccd94ca3041b1af9d287b4a8f
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Tue Jul 31 11:29:05 2018 +0200

    common: Convert monitor geometry to device geometry
    
    Bug: 14566
    
    `xfwm_get_monitor_geometry()` uses `gdk_monitor_get_geometry()` which
    returns the monitor geometry ion logical coordinates, not device
    coordinates.
    
    Apply the scale back to the geometry to get the device pixels.
    
    Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
 common/xfwm-common.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/common/xfwm-common.c b/common/xfwm-common.c
index fd69846..a991b35 100644
--- a/common/xfwm-common.c
+++ b/common/xfwm-common.c
@@ -83,10 +83,18 @@ xfwm_get_monitor_geometry (GdkScreen    *screen,
 #if GTK_CHECK_VERSION(3, 22, 0)
   GdkDisplay *display;
   GdkMonitor *monitor;
+  int scale;
 
   display = gdk_screen_get_display (screen);
   monitor = gdk_display_get_monitor (display, monitor_num);
   gdk_monitor_get_geometry (monitor, geometry);
+
+  /* Convert to device pixels */
+  scale = gdk_monitor_get_scale_factor (monitor);
+  geometry->x *= scale;
+  geometry->y *= scale;
+  geometry->width *= scale;
+  geometry->height *= scale;
 #else
   gdk_screen_get_monitor_geometry (screen, monitor_num, geometry);
 #endif

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list