aboutsummaryrefslogtreecommitdiff
path: root/xwayland
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2022-12-05 21:13:19 +0300
committerSimon Zeni <simon@bl4ckb0ne.ca>2023-02-01 16:13:21 +0000
commitfbf5982e3838ee28b5345e98832f6956c402b225 (patch)
treeba2f34e9e81f43cf2fc1ceeff37fa4ee615ad6a4 /xwayland
parent21f8388b580ab2fc6637c590ccf4a5a87ef8e158 (diff)
xwayland/xwm: introduce wlr_xwayland_surface_try_from_wlr_surface()
This new function replaces wlr_surface_is_xwayland_surface() and wlr_xwayland_surface_from_wlr_surface().
Diffstat (limited to 'xwayland')
-rw-r--r--xwayland/xwm.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c
index 64052ef6..dab2cf85 100644
--- a/xwayland/xwm.c
+++ b/xwayland/xwm.c
@@ -101,14 +101,12 @@ struct pending_startup_id {
static const struct wlr_addon_interface surface_addon_impl;
-bool wlr_surface_is_xwayland_surface(struct wlr_surface *surface) {
- return wlr_addon_find(&surface->addons, NULL, &surface_addon_impl) != NULL;
-}
-
-struct wlr_xwayland_surface *wlr_xwayland_surface_from_wlr_surface(
+struct wlr_xwayland_surface *wlr_xwayland_surface_try_from_wlr_surface(
struct wlr_surface *surface) {
struct wlr_addon *addon = wlr_addon_find(&surface->addons, NULL, &surface_addon_impl);
- assert(addon != NULL);
+ if (addon == NULL) {
+ return NULL;
+ }
struct wlr_xwayland_surface *xsurface = wl_container_of(addon, xsurface, surface_addon);
return xsurface;
}