diff options
author | Kirill Primak <vyivel@eclair.cafe> | 2023-03-09 13:02:13 +0300 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-06-02 20:11:42 +0200 |
commit | 72881b5d120442e3a6f9c5b022c8d9cc05cb27c0 (patch) | |
tree | afe21d55061ca28b38b3c805713a857212a64755 | |
parent | 48d6eda3cb0f79d2190756af44f01d028696bf0e (diff) |
xwayland: don't rely on event source being data
This pattern is being slowly removed from wlroots.
-rw-r--r-- | sway/desktop/xwayland.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 9c29f66b..bcefc4fd 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -125,7 +125,9 @@ static void unmanaged_handle_unmap(struct wl_listener *listener, void *data) { } static void unmanaged_handle_request_activate(struct wl_listener *listener, void *data) { - struct wlr_xwayland_surface *xsurface = data; + struct sway_xwayland_unmanaged *surface = + wl_container_of(listener, surface, request_activate); + struct wlr_xwayland_surface *xsurface = surface->wlr_xwayland_surface; if (!xsurface->mapped) { return; } @@ -495,8 +497,8 @@ static void handle_unmap(struct wl_listener *listener, void *data) { static void handle_map(struct wl_listener *listener, void *data) { struct sway_xwayland_view *xwayland_view = wl_container_of(listener, xwayland_view, map); - struct wlr_xwayland_surface *xsurface = data; struct sway_view *view = &xwayland_view->view; + struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; view->natural_width = xsurface->width; view->natural_height = xsurface->height; @@ -515,8 +517,8 @@ static void handle_map(struct wl_listener *listener, void *data) { static void handle_override_redirect(struct wl_listener *listener, void *data) { struct sway_xwayland_view *xwayland_view = wl_container_of(listener, xwayland_view, override_redirect); - struct wlr_xwayland_surface *xsurface = data; struct sway_view *view = &xwayland_view->view; + struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; bool mapped = xsurface->mapped; if (mapped) { |