From cf09ea184b891594331240eb860f28975dcb8b8c Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 30 Mar 2018 13:34:25 -0400 Subject: [PATCH] Use the new map/unmap events for xwayland views --- include/sway/tree/view.h | 4 ++-- sway/desktop/xwayland.c | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index e5f53f4e..54f6d90e 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -28,8 +28,8 @@ struct sway_xwayland_surface { struct wl_listener request_resize; struct wl_listener request_maximize; struct wl_listener request_configure; - struct wl_listener unmap_notify; - struct wl_listener map_notify; + struct wl_listener unmap; + struct wl_listener map; struct wl_listener destroy; int pending_width, pending_height; diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 3e08b20e..13eaf79a 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -119,9 +119,9 @@ static void handle_destroy(struct wl_listener *listener, void *data) { free(sway_surface); } -static void handle_unmap_notify(struct wl_listener *listener, void *data) { +static void handle_unmap(struct wl_listener *listener, void *data) { struct sway_xwayland_surface *sway_surface = - wl_container_of(listener, sway_surface, unmap_notify); + wl_container_of(listener, sway_surface, unmap); wl_list_remove(&sway_surface->view->unmanaged_view_link); wl_list_init(&sway_surface->view->unmanaged_view_link); @@ -136,10 +136,10 @@ static void handle_unmap_notify(struct wl_listener *listener, void *data) { sway_surface->view->surface = NULL; } -static void handle_map_notify(struct wl_listener *listener, void *data) { +static void handle_map(struct wl_listener *listener, void *data) { // TODO put the view back into the tree struct sway_xwayland_surface *sway_surface = - wl_container_of(listener, sway_surface, map_notify); + wl_container_of(listener, sway_surface, map); struct wlr_xwayland_surface *xsurface = data; sway_surface->view->surface = xsurface->surface; @@ -221,11 +221,11 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) { &sway_surface->request_configure); sway_surface->request_configure.notify = handle_configure_request; - wl_signal_add(&xsurface->events.unmap_notify, &sway_surface->unmap_notify); - sway_surface->unmap_notify.notify = handle_unmap_notify; + wl_signal_add(&xsurface->events.unmap, &sway_surface->unmap); + sway_surface->unmap.notify = handle_unmap; - wl_signal_add(&xsurface->events.map_notify, &sway_surface->map_notify); - sway_surface->map_notify.notify = handle_map_notify; + wl_signal_add(&xsurface->events.map, &sway_surface->map); + sway_surface->map.notify = handle_map; - handle_map_notify(&sway_surface->map_notify, xsurface); + handle_map(&sway_surface->map, xsurface); }