compositor: add a way to disable picking of client surfaces
Surfaces like drag'n'drop icons shouldn't receive events as a normal surface but are still created by the client so add a way for the compositor to enable or disable the picking of a client surface. Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
This commit is contained in:
committed by
Kristian Høgsberg
parent
a1ff53b31a
commit
d595f65fe2
+3
-1
@@ -544,7 +544,7 @@ weston_compositor_pick_surface(struct weston_compositor *compositor,
|
|||||||
struct weston_surface *surface;
|
struct weston_surface *surface;
|
||||||
|
|
||||||
wl_list_for_each(surface, &compositor->surface_list, link) {
|
wl_list_for_each(surface, &compositor->surface_list, link) {
|
||||||
if (surface->surface.resource.client == NULL)
|
if (!surface->pickable)
|
||||||
continue;
|
continue;
|
||||||
weston_surface_from_global(surface, x, y, sx, sy);
|
weston_surface_from_global(surface, x, y, sx, sy);
|
||||||
if (0 <= *sx && *sx < surface->geometry.width &&
|
if (0 <= *sx && *sx < surface->geometry.width &&
|
||||||
@@ -1270,6 +1270,8 @@ compositor_create_surface(struct wl_client *client,
|
|||||||
(void (**)(void)) &surface_interface;
|
(void (**)(void)) &surface_interface;
|
||||||
surface->surface.resource.data = surface;
|
surface->surface.resource.data = surface;
|
||||||
|
|
||||||
|
surface->pickable = 1;
|
||||||
|
|
||||||
wl_client_add_resource(client, &surface->surface.resource);
|
wl_client_add_resource(client, &surface->surface.resource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -251,6 +251,7 @@ struct weston_surface {
|
|||||||
uint32_t alpha;
|
uint32_t alpha;
|
||||||
uint32_t visual;
|
uint32_t visual;
|
||||||
int overlapped;
|
int overlapped;
|
||||||
|
int pickable;
|
||||||
|
|
||||||
/* Surface geometry state, mutable.
|
/* Surface geometry state, mutable.
|
||||||
* If you change anything, set dirty = 1.
|
* If you change anything, set dirty = 1.
|
||||||
|
|||||||
Reference in New Issue
Block a user