wayland/tablet-tool: Check for non-NULL surface resource

A MetaWaylandSurface object can outlive the corresponding wl_surface
object since https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1880 .

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3320
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3632>
This commit is contained in:
Michel Dänzer 2024-03-02 15:48:48 +01:00 committed by Robert Mader
parent 71175a2fd0
commit 0690addcfc

View File

@ -333,7 +333,7 @@ meta_wayland_tablet_tool_set_focus (MetaWaylandTabletTool *tool,
tool->focus_surface = NULL;
}
if (surface != NULL && tool->current_tablet)
if (surface != NULL && surface->resource != NULL && tool->current_tablet)
{
struct wl_client *client;
struct wl_list *l;