summaryrefslogtreecommitdiff
path: root/sway/desktop/xwayland.c
diff options
context:
space:
mode:
authorDominique Martinet <[email protected]>2018-06-30 14:00:24 +0900
committerDominique Martinet <[email protected]>2018-06-30 22:31:14 +0900
commit9ea4cc13a0cf2d231c4e4c71aa674cd76831e6f9 (patch)
treea4f6056b5cfa80e065f366d20e1d97957d3ee393 /sway/desktop/xwayland.c
parentd8c61c976372eedf271f505ffd82c461b6503f6f (diff)
sway views: add helpers to get view and layer from wlr_surface
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r--sway/desktop/xwayland.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 6e63c505..4bb35f60 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -417,6 +417,11 @@ static void handle_set_window_type(struct wl_listener *listener, void *data) {
view_execute_criteria(view);
}
+struct sway_view *view_from_wlr_xwayland_surface(
+ struct wlr_xwayland_surface *xsurface) {
+ return xsurface->data;
+}
+
void handle_xwayland_surface(struct wl_listener *listener, void *data) {
struct sway_server *server = wl_container_of(listener, server,
xwayland_surface);
@@ -470,6 +475,8 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
wl_signal_add(&xsurface->events.map, &xwayland_view->map);
xwayland_view->map.notify = handle_map;
+
+ xsurface->data = xwayland_view;
}
void handle_xwayland_ready(struct wl_listener *listener, void *data) {