Clients: Don't set the cursor when we have no pointer
Avoids a segfault whenever we get a key event, and try to set the cursor, dereferencing a NULL input->pointer. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
committed by
Kristian Høgsberg
parent
0f7a285fe1
commit
8097274ce6
@@ -2613,6 +2613,9 @@ input_set_pointer_image_index(struct input *input, int index)
|
|||||||
struct wl_cursor *cursor;
|
struct wl_cursor *cursor;
|
||||||
struct wl_cursor_image *image;
|
struct wl_cursor_image *image;
|
||||||
|
|
||||||
|
if (!input->pointer)
|
||||||
|
return;
|
||||||
|
|
||||||
cursor = input->display->cursors[input->current_cursor];
|
cursor = input->display->cursors[input->current_cursor];
|
||||||
if (!cursor)
|
if (!cursor)
|
||||||
return;
|
return;
|
||||||
@@ -2652,6 +2655,9 @@ pointer_surface_frame_callback(void *data, struct wl_callback *callback,
|
|||||||
input->cursor_frame_cb = NULL;
|
input->cursor_frame_cb = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!input->pointer)
|
||||||
|
return;
|
||||||
|
|
||||||
if (input->current_cursor == CURSOR_BLANK) {
|
if (input->current_cursor == CURSOR_BLANK) {
|
||||||
wl_pointer_set_cursor(input->pointer,
|
wl_pointer_set_cursor(input->pointer,
|
||||||
input->pointer_enter_serial,
|
input->pointer_enter_serial,
|
||||||
|
|||||||
Reference in New Issue
Block a user