remove a useless check

if `s->role_data == NULL`, wlr_*_surface_from_wlr_surface() will return NULL
and we are checking it
This commit is contained in:
Leonardo Hernández Hernández 2022-07-15 00:48:28 -05:00
parent af12e777f2
commit e98719f552
No known key found for this signature in database
GPG Key ID: E538897EE11B9624

View File

@ -242,11 +242,11 @@ client_from_wlr_surface(struct wlr_surface *s)
#ifdef XWAYLAND #ifdef XWAYLAND
struct wlr_xwayland_surface *xsurface; struct wlr_xwayland_surface *xsurface;
if (s->role_data && wlr_surface_is_xwayland_surface(s) if (wlr_surface_is_xwayland_surface(s)
&& (xsurface = wlr_xwayland_surface_from_wlr_surface(s))) && (xsurface = wlr_xwayland_surface_from_wlr_surface(s)))
return xsurface->data; return xsurface->data;
#endif #endif
if (s->role_data && wlr_surface_is_xdg_surface(s) if (wlr_surface_is_xdg_surface(s)
&& (surface = wlr_xdg_surface_from_wlr_surface(s)) && (surface = wlr_xdg_surface_from_wlr_surface(s))
&& surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) && surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL)
return surface->data; return surface->data;