wayland: Don't send proximity_in for new resources

Mutter sends a proximity-in event before the required tablet tool
resource is properly allocated on the client. This is violating the
Wayland protocol. Because libwayland ignores events for objects it
doesn't know yet, this is not noticeable in most applications. However,
if https://gitlab.freedesktop.org/wayland/wayland/-/issues/176 gets
fixed, these applications would likely crash immediately. Therefore this
PR removes the responsible code which, again, shouldn't have any effect
on client applications as they ignore this event anyway.

Relevant part of the spec:

    This event can be received when the tool has moved from one surface to
    another, or when the tool has come back into proximity above the
    surface.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1427
This commit is contained in:
Julius Lehmann 2020-09-03 21:16:54 +02:00 committed by Jonas Ådahl
parent 935d594978
commit 433b59f74a

View File

@ -531,24 +531,6 @@ static const struct zwp_tablet_tool_v2_interface tool_interface = {
tool_destroy tool_destroy
}; };
static void
emit_proximity_in (MetaWaylandTabletTool *tool,
struct wl_resource *resource)
{
struct wl_resource *tablet_resource;
struct wl_client *client;
if (!tool->focus_surface)
return;
client = wl_resource_get_client (resource);
tablet_resource = meta_wayland_tablet_lookup_resource (tool->current_tablet,
client);
zwp_tablet_tool_v2_send_proximity_in (resource, tool->proximity_serial,
tablet_resource, tool->focus_surface->resource);
}
struct wl_resource * struct wl_resource *
meta_wayland_tablet_tool_create_new_resource (MetaWaylandTabletTool *tool, meta_wayland_tablet_tool_create_new_resource (MetaWaylandTabletTool *tool,
struct wl_client *client, struct wl_client *client,
@ -567,7 +549,6 @@ meta_wayland_tablet_tool_create_new_resource (MetaWaylandTabletTool *tool,
wl_resource_get_client (tool->focus_surface->resource) == client) wl_resource_get_client (tool->focus_surface->resource) == client)
{ {
wl_list_insert (&tool->focus_resource_list, wl_resource_get_link (resource)); wl_list_insert (&tool->focus_resource_list, wl_resource_get_link (resource));
emit_proximity_in (tool, resource);
} }
else else
{ {