mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-12-22 09:59:48 +01:00
xwayland/shell: add wlr_xwayland_shell_v1_surface_from_serial()
This commit is contained in:
parent
d19191ff6b
commit
85b37127a6
2 changed files with 19 additions and 0 deletions
|
@ -70,4 +70,12 @@ void wlr_xwayland_shell_v1_destroy(struct wlr_xwayland_shell_v1 *shell);
|
|||
void wlr_xwayland_shell_v1_set_client(struct wlr_xwayland_shell_v1 *shell,
|
||||
struct wl_client *client);
|
||||
|
||||
/**
|
||||
* Get a Wayland surface from an xwayland_shell_v1 serial.
|
||||
*
|
||||
* Returns NULL if the serial hasn't been associated with any surface.
|
||||
*/
|
||||
struct wlr_surface *wlr_xwayland_shell_v1_surface_from_serial(
|
||||
struct wlr_xwayland_shell_v1 *shell, uint64_t serial);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -224,3 +224,14 @@ void wlr_xwayland_shell_v1_set_client(struct wlr_xwayland_shell_v1 *shell,
|
|||
wl_list_init(&shell->client_destroy.link);
|
||||
}
|
||||
}
|
||||
|
||||
struct wlr_surface *wlr_xwayland_shell_v1_surface_from_serial(
|
||||
struct wlr_xwayland_shell_v1 *shell, uint64_t serial) {
|
||||
struct wlr_xwayland_surface_v1 *xwl_surface;
|
||||
wl_list_for_each(xwl_surface, &shell->surfaces, link) {
|
||||
if (xwl_surface->serial == serial) {
|
||||
return xwl_surface->surface;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue