GNOME Bugzilla – Bug 711518
mutter-wl: Support setting a NULL opaque region.
Last modified: 2013-11-05 23:19:37 UTC
Created attachment 259047 [details] [review] mutter-wl: Support setting a NULL opaque region. According to the wayland spec (A.14.1.5. wl_surface::set_opaque_region), setting a NULL opaque region is possible and should case the pending opaque region to be set to empty. This implements the required behavoir similar to how weston does it. Previously the weston-simple-egl demo client caused mutter-wayland to crash with a segfault in meta_wayland_surface_set_opaque_region, with this patch it works as intended. This is my first patch to mutter/gnome, so please tell me if there is anything I could do better when submitting patches.
Review of attachment 259047 [details] [review]: ::: src/wayland/meta-wayland-surface.c @@ +220,3 @@ + else + { + empty_region (&surface->pending.opaque_region); This doesn't make sense to me. First of all, surface->pending.opaque_region is already a cairo_region_t*, and this is passing a cairo_region_t**. How did this compile / work? Also, why not simply set the opaque_region to NULL? That should work perfectly fine.
Created attachment 259048 [details] [review] mutter-wl: Support setting a NULL opaque region V2 Implements the review suggestion of simply setting the region to NULL, and this time I double checked that I actually upload the right version of the patch.
Review of attachment 259048 [details] [review]: Can you fix input_region too while you're at it? This looks correct.
Created attachment 259052 [details] [review] mutter-wl: Support setting a NULL surface regions. Also fixes set_input_region. I did a quick test that it actually works with a simple program calling "wl_surface_set_input_region(window->surface, NULL);" and it looked good to me.