mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-15 06:59:43 -05:00
xdg-shell: add wlr_xdg_{toplevel,popup}_try_from_wlr_surface()
Convenience helpers for compositors. Saves them the trouble of manually checking the role (and if they forget to do so, prevents an invalid cast).
This commit is contained in:
parent
5de9e1a99d
commit
319e4125ab
3 changed files with 34 additions and 0 deletions
|
|
@ -485,6 +485,24 @@ struct wlr_surface *wlr_xdg_surface_popup_surface_at(
|
|||
*/
|
||||
struct wlr_xdg_surface *wlr_xdg_surface_try_from_wlr_surface(struct wlr_surface *surface);
|
||||
|
||||
/**
|
||||
* Get a struct wlr_xdg_toplevel from a struct wlr_surface.
|
||||
*
|
||||
* Returns NULL if the surface doesn't have the xdg_surface role, the
|
||||
* xdg_surface is not a toplevel, or the xdg_surface/xdg_toplevel objects have
|
||||
* been destroyed.
|
||||
*/
|
||||
struct wlr_xdg_toplevel *wlr_xdg_toplevel_try_from_wlr_surface(struct wlr_surface *surface);
|
||||
|
||||
/**
|
||||
* Get a struct wlr_xdg_popup from a struct wlr_surface.
|
||||
*
|
||||
* Returns NULL if the surface doesn't have the xdg_surface role, the
|
||||
* xdg_surface is not a popup, or the xdg_surface/xdg_popup objects have
|
||||
* been destroyed.
|
||||
*/
|
||||
struct wlr_xdg_popup *wlr_xdg_popup_try_from_wlr_surface(struct wlr_surface *surface);
|
||||
|
||||
/**
|
||||
* Get the surface geometry.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue