summaryrefslogtreecommitdiff
path: root/gdk/wayland
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2014-11-07 17:16:59 +0100
committerCarlos Garnacho <carlosg@gnome.org>2014-11-07 17:23:54 +0100
commit964abf74235caa5cbeab64e845c4b35ac340b860 (patch)
treef10e5d636b3f63c7d12a3899f7fe1834774e569b /gdk/wayland
parent52a90758f961d39fe92c12546136849991b28ddd (diff)
downloadgtk+-964abf74235caa5cbeab64e845c4b35ac340b860.tar.gz
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.
Diffstat (limited to 'gdk/wayland')
-rw-r--r--gdk/wayland/gdkwindow-wayland.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 96d9dc66d3..b49dda32fe 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -1437,8 +1437,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);
}