xdg shell: add wlr_xdg_surface_popup_surface_at()

This function will allow compositors to implement input handling in a
way consistent with rendering more easily.

Calling wlr_xdg_surface_surface_at() and checking if the result is a
wlr_xdg_popup is flawed as there may be subsurfaces in the popup tree.
This commit is contained in:
Isaac Freund 2021-01-07 15:04:08 +01:00 committed by Simon Ser
parent c5c5ab9724
commit 8f63557ed7
2 changed files with 21 additions and 1 deletions

View file

@ -369,6 +369,15 @@ struct wlr_surface *wlr_xdg_surface_surface_at(
struct wlr_xdg_surface *surface, double sx, double sy,
double *sub_x, double *sub_y);
/**
* Find a surface within this xdg-surface's popup tree at the given
* surface-local coordinates. Returns the surface and coordinates in the leaf
* surface coordinate system or NULL if no surface is found at that location.
*/
struct wlr_surface *wlr_xdg_surface_popup_surface_at(
struct wlr_xdg_surface *surface, double sx, double sy,
double *sub_x, double *sub_y);
bool wlr_surface_is_xdg_surface(struct wlr_surface *surface);
struct wlr_xdg_surface *wlr_xdg_surface_from_wlr_surface(