From 2995bc981ddda7c6cd5b6dfde3227caf351b4195 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 28 Oct 2022 12:37:32 -0500 Subject: [PATCH] input: Complain if we focus a surface with a coordinate outside it Not all callers of weston_pointer_set_focus use weston_compositor_pick_view to get their coordinate, so let's log something if the coordinate doesn't make sense. Signed-off-by: Derek Foreman --- libweston/input.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libweston/input.c b/libweston/input.c index 407c22a4..d402e309 100644 --- a/libweston/input.c +++ b/libweston/input.c @@ -1441,6 +1441,15 @@ weston_pointer_set_focus(struct weston_pointer *pointer, struct wl_list *focus_resource_list; int refocus = 0; + if (view) { + int ix = wl_fixed_to_int(sx); + int iy = wl_fixed_to_int(sy); + + if (!weston_view_takes_input_at_point(view, ix, iy)) + weston_log("View focused with external coordinate %d, %d\n", + ix, iy); + } + if ((!pointer->focus && view) || (pointer->focus && !view) || (pointer->focus && pointer->focus->surface != view->surface) ||