xdg-shell: add/use wlr_xdg_{toplevel,popup}_from_wlr_xdg_surface()

This commit is contained in:
Kirill Primak 2024-08-14 16:09:38 +03:00
parent 21bda78b85
commit a0fab7b1e8
4 changed files with 53 additions and 20 deletions

View file

@ -514,6 +514,15 @@ struct wlr_xdg_surface *wlr_xdg_surface_try_from_wlr_surface(struct wlr_surface
*/
struct wlr_xdg_toplevel *wlr_xdg_toplevel_try_from_wlr_surface(struct wlr_surface *surface);
/**
* Get a struct wlr_xdg_toplevel from a struct wlr_xdg_surface.
*
* Returns NULL if the xdg_surface doesn't have the xdg_toplevel role or if the
* xdg_toplevel has been destroyed.
*/
struct wlr_xdg_toplevel *wlr_xdg_toplevel_try_from_wlr_xdg_surface(
struct wlr_xdg_surface *xdg_surface);
/**
* Get a struct wlr_xdg_popup from a struct wlr_surface.
*
@ -523,6 +532,15 @@ struct wlr_xdg_toplevel *wlr_xdg_toplevel_try_from_wlr_surface(struct wlr_surfac
*/
struct wlr_xdg_popup *wlr_xdg_popup_try_from_wlr_surface(struct wlr_surface *surface);
/**
* Get a struct wlr_xdg_popup from a struct wlr_xdg_surface.
*
* Returns NULL if the xdg_surface doesn't have the xdg_popup role or if the
* xdg_popup has been destroyed.
*/
struct wlr_xdg_popup *wlr_xdg_popup_try_from_wlr_xdg_surface(
struct wlr_xdg_surface *xdg_surface);
/**
* Get the surface geometry.
*