input: make sure pointer->focus is set before trusting pointer->sx,sy

We're just going to crash at weston_view_from_global_fixed() anyway if
this is untrue, but we have a similar assertion elsewhere already.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2022-10-31 12:41:32 -05:00 committed by Pekka Paalanen
parent 9b5a525a3d
commit de306e4601

View file

@ -4613,6 +4613,8 @@ weston_pointer_clamp_event_to_region(struct weston_pointer *pointer,
float new_x_f, new_y_f;
uint32_t directions;
assert(pointer->focus);
weston_pointer_motion_to_abs(pointer, event, &x, &y);
weston_view_from_global_fixed(pointer->focus, x, y, &sx, &sy);