[gtk+] gdkwindow-x11: Multiply opaque region rects by the window scale



commit 29dda194bb57066d48c8a5ed2a435a86bb76b971
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Sep 4 14:45:01 2013 -0400

    gdkwindow-x11: Multiply opaque region rects by the window scale
    
    This fixes rendering issues under HiDPI

 gdk/x11/gdkwindow-x11.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index e5b3ffe..b11909f 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -5559,11 +5559,14 @@ static void
 gdk_x11_window_set_opaque_region (GdkWindow      *window,
                                   cairo_region_t *region)
 {
+  GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
   GdkDisplay *display;
-
   int nitems;
   gulong *data;
 
+  if (GDK_WINDOW_DESTROYED (window))
+    return;
+
   if (region != NULL)
     {
       int i, nrects;
@@ -5576,10 +5579,10 @@ gdk_x11_window_set_opaque_region (GdkWindow      *window,
         {
           cairo_rectangle_int_t rect;
           cairo_region_get_rectangle (region, i, &rect);
-          data[i*4+0] = rect.x;
-          data[i*4+1] = rect.y;
-          data[i*4+2] = rect.width;
-          data[i*4+3] = rect.height;
+          data[i*4+0] = rect.x * impl->window_scale;
+          data[i*4+1] = rect.y * impl->window_scale;
+          data[i*4+2] = rect.width * impl->window_scale;
+          data[i*4+3] = rect.height * impl->window_scale;
         }
     }
   else


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