[gtk+/gtk-3-14] wayland: Don't translate a NULL region into an empty one



commit 527d262804017d23540c182da0671023f9c8ff1b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Nov 7 17:16:59 2014 +0100

    wayland: Don't translate a NULL region into an empty one
    
    cairo_region_copy(NULL) will effectively return an empty region, as this
    function is always meant to return valid memory. This however inverts the
    meaning of the NULL region and results in entirely non-clickable windows.

 gdk/wayland/gdkwindow-wayland.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 31f3116..2d9b033 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -1402,8 +1402,13 @@ gdk_window_wayland_input_shape_combine_region (GdkWindow            *window,
     return;
 
   g_clear_pointer (&impl->input_region, cairo_region_destroy);
-  impl->input_region = cairo_region_copy (shape_region);
-  cairo_region_translate (impl->input_region, offset_x, offset_y);
+
+  if (shape_region)
+    {
+      impl->input_region = cairo_region_copy (shape_region);
+      cairo_region_translate (impl->input_region, offset_x, offset_y);
+    }
+
   gdk_wayland_window_sync_input_region (window);
 }
 


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