Fix cursor role name, fix segfault when surface->resource is NULL

This commit is contained in:
emersion 2017-10-14 12:21:36 +02:00
parent 29abf93bb6
commit 8fd4ae5de8
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
3 changed files with 4 additions and 4 deletions

View file

@ -306,8 +306,8 @@ static void handle_request_set_cursor(struct wl_listener *listener,
struct wlr_surface *focused_surface =
event->seat_handle->wlr_seat->pointer_state.focused_surface;
bool ok = focused_surface != NULL;
if (focused_surface != NULL) {
bool ok = focused_surface != NULL && focused_surface->resource != NULL;
if (ok) {
struct wl_client *focused_client =
wl_resource_get_client(focused_surface->resource);
ok = event->client == focused_client;