Add wlr_surface_point_accepts_input

Ref https://github.com/swaywm/sway/pull/1674
This commit is contained in:
Drew DeVault 2018-03-30 22:19:33 -04:00
parent 2053a4c144
commit e19ee6d469
3 changed files with 12 additions and 12 deletions

View file

@ -952,3 +952,10 @@ void wlr_surface_set_role_committed(struct wlr_surface *surface,
surface->role_committed = role_committed;
surface->role_data = role_data;
}
bool wlr_surface_point_accepts_input(
struct wlr_surface *surface, double sx, double sy) {
return sx >= 0 && sx <= surface->current->width &&
sy >= 0 && sy <= surface->current->height &&
pixman_region32_contains_point(&surface->current->input, sx, sy, NULL);
}