diff --git a/src/compositor/meta-surface-actor-wayland.c b/src/compositor/meta-surface-actor-wayland.c index 069c511e1..a9ec55853 100644 --- a/src/compositor/meta-surface-actor-wayland.c +++ b/src/compositor/meta-surface-actor-wayland.c @@ -197,6 +197,10 @@ meta_surface_actor_wayland_sync_state (MetaSurfaceActorWayland *self) scaled_input_region); cairo_region_destroy (scaled_input_region); } + else + { + meta_surface_actor_set_input_region (META_SURFACE_ACTOR (self), NULL); + } /* Opaque region */ if (surface->opaque_region) @@ -212,6 +216,10 @@ meta_surface_actor_wayland_sync_state (MetaSurfaceActorWayland *self) scaled_opaque_region); cairo_region_destroy (scaled_opaque_region); } + else + { + meta_surface_actor_set_opaque_region (META_SURFACE_ACTOR (self), NULL); + } meta_surface_actor_wayland_sync_subsurface_state (self); } diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index 3eb0b0e9d..e4a4e5a97 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -332,7 +332,9 @@ pending_state_init (MetaWaylandPendingState *state) state->scale = 0; state->input_region = NULL; + state->input_region_set = FALSE; state->opaque_region = NULL; + state->opaque_region_set = FALSE; state->damage = cairo_region_create (); state->buffer_destroy_listener.notify = surface_handle_pending_buffer_destroy; @@ -510,18 +512,24 @@ apply_pending_state (MetaWaylandSurface *surface, surface->offset_x += pending->dx; surface->offset_y += pending->dy; - if (pending->opaque_region) + if (pending->opaque_region_set) { if (surface->opaque_region) cairo_region_destroy (surface->opaque_region); - surface->opaque_region = cairo_region_reference (pending->opaque_region); + if (pending->opaque_region) + surface->opaque_region = cairo_region_reference (pending->opaque_region); + else + surface->opaque_region = NULL; } - if (pending->input_region) + if (pending->input_region_set) { if (surface->input_region) cairo_region_destroy (surface->input_region); - surface->input_region = cairo_region_reference (pending->input_region); + if (pending->input_region) + surface->input_region = cairo_region_reference (pending->input_region); + else + surface->input_region = NULL; } /* wl_surface.frame */ @@ -678,6 +686,7 @@ wl_surface_set_opaque_region (struct wl_client *client, cairo_region_t *cr_region = meta_wayland_region_peek_cairo_region (region); surface->pending.opaque_region = cairo_region_copy (cr_region); } + surface->pending.opaque_region_set = TRUE; } static void @@ -698,6 +707,7 @@ wl_surface_set_input_region (struct wl_client *client, cairo_region_t *cr_region = meta_wayland_region_peek_cairo_region (region); surface->pending.input_region = cairo_region_copy (cr_region); } + surface->pending.input_region_set = TRUE; } static void diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h index e599af6ad..d75238166 100644 --- a/src/wayland/meta-wayland-surface.h +++ b/src/wayland/meta-wayland-surface.h @@ -62,7 +62,9 @@ typedef struct cairo_region_t *damage; cairo_region_t *input_region; + gboolean input_region_set; cairo_region_t *opaque_region; + gboolean opaque_region_set; /* wl_surface.frame */ struct wl_list frame_callback_list;