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 <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2022-10-28 12:37:32 -05:00 committed by Pekka Paalanen
parent e2e0a73335
commit 2995bc981d
1 changed files with 9 additions and 0 deletions

View File

@ -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) ||