Merge pull request #629 from emersion/safe-wl-resource-get-user-data

Wrap wl_resource_get_user_data into safer helper functions
This commit is contained in:
Drew DeVault 2018-02-16 09:27:26 -05:00 committed by GitHub
commit 8c1cc45c7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 474 additions and 213 deletions

View file

@ -742,7 +742,7 @@ static void xwm_handle_surface_id_message(struct wlr_xwm *xwm,
struct wl_resource *resource =
wl_client_get_object(xwm->xwayland->client, id);
if (resource) {
struct wlr_surface *surface = wl_resource_get_user_data(resource);
struct wlr_surface *surface = wlr_surface_from_resource(resource);
xsurface->surface_id = 0;
xwm_map_shell_surface(xwm, xsurface, surface);
} else {