aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-10-14 12:21:36 +0200
committeremersion <contact@emersion.fr>2017-10-14 12:21:36 +0200
commit8fd4ae5de86b62e482e338113e94f23ee183d28d (patch)
tree4e4e22dabe5511617add2d12075e168b4c55c04b /rootston
parent29abf93bb6a52101a53ece0b23e3b24c593a737e (diff)
Fix cursor role name, fix segfault when surface->resource is NULL
Diffstat (limited to 'rootston')
-rw-r--r--rootston/cursor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rootston/cursor.c b/rootston/cursor.c
index 4c3a9947..03189587 100644
--- a/rootston/cursor.c
+++ b/rootston/cursor.c
@@ -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;