From be3bca01a7b8f2cf9d37f1d1a51a21bf86a78ed9 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 15 Aug 2023 17:14:29 +0200 Subject: [PATCH] clutter: Check that pointer has coordinates prior to repick This might fail during initialization, or after first pointer interaction on a pointer-less (e.g. touch-only) session. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2964 Part-of: --- clutter/clutter/clutter-stage.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c index a2044fafd..aa87e3eea 100644 --- a/clutter/clutter/clutter-stage.c +++ b/clutter/clutter/clutter-stage.c @@ -3515,9 +3515,11 @@ void clutter_stage_repick_device (ClutterStage *stage, ClutterInputDevice *device) { - graphene_point_t point; + graphene_point_t point = GRAPHENE_POINT_INIT_ZERO; + + if (!clutter_stage_get_device_coords (stage, device, NULL, &point)) + return; - clutter_stage_get_device_coords (stage, device, NULL, &point); clutter_stage_pick_and_update_device (stage, device, NULL, NULL,