From d56af70dc1e683a7ae95ea63edc6a0a1ea25c072 Mon Sep 17 00:00:00 2001 From: Mariusz Bialonczyk Date: Tue, 2 Jan 2024 19:55:19 +0100 Subject: [PATCH] [uwac] input: fix a crash when the pointer_focus is not set yet when starting --- uwac/libuwac/uwac-input.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/uwac/libuwac/uwac-input.c b/uwac/libuwac/uwac-input.c index 51abc62eb..ab22392fc 100644 --- a/uwac/libuwac/uwac-input.c +++ b/uwac/libuwac/uwac-input.c @@ -102,7 +102,10 @@ static UwacReturnCode set_cursor_image(UwacSeat* seat, uint32_t serial) if (!seat || !seat->display || !seat->default_cursor || !seat->default_cursor->images) return UWAC_ERROR_INTERNAL; - int scale = seat->pointer_focus->display->actual_scale; + int scale = 1; + if (seat->pointer_focus) + scale = seat->pointer_focus->display->actual_scale; + switch (seat->pointer_type) { case 2: /* Custom poiner */