diff --git a/src/compositor.c b/src/compositor.c index 237509f9..31e26d8c 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -544,7 +544,7 @@ weston_compositor_pick_surface(struct weston_compositor *compositor, struct weston_surface *surface; wl_list_for_each(surface, &compositor->surface_list, link) { - if (surface->surface.resource.client == NULL) + if (!surface->pickable) continue; weston_surface_from_global(surface, x, y, sx, sy); if (0 <= *sx && *sx < surface->geometry.width && @@ -1270,6 +1270,8 @@ compositor_create_surface(struct wl_client *client, (void (**)(void)) &surface_interface; surface->surface.resource.data = surface; + surface->pickable = 1; + wl_client_add_resource(client, &surface->surface.resource); } diff --git a/src/compositor.h b/src/compositor.h index 966d3f41..6c108055 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -251,6 +251,7 @@ struct weston_surface { uint32_t alpha; uint32_t visual; int overlapped; + int pickable; /* Surface geometry state, mutable. * If you change anything, set dirty = 1.