mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-06 03:28:00 +02:00
compositor: Avoid sending event for invalid point
Avoid sending a touch down event using uninitialised surface x/y co-ordinates. Instead present a log message about this unexpected case.
This commit is contained in:
parent
15b3caf2ea
commit
f14a241f35
1 changed files with 7 additions and 0 deletions
|
|
@ -1943,6 +1943,13 @@ notify_touch(struct weston_seat *seat, uint32_t time, int touch_id,
|
|||
} else if (touch->focus) {
|
||||
es = (struct weston_surface *) touch->focus;
|
||||
weston_surface_from_global_fixed(es, x, y, &sx, &sy);
|
||||
} else {
|
||||
/* Unexpected condition: We have non-initial touch but
|
||||
* there is no focused surface.
|
||||
*/
|
||||
weston_log("touch event received with %d points down"
|
||||
"but no surface focused\n", seat->num_tp);
|
||||
return;
|
||||
}
|
||||
|
||||
grab->interface->down(grab, time, touch_id, sx, sy);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue