mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Merge pull request #1667 from emersion/wlroots-xwayland-map
Use the new map/unmap events for xwayland views
This commit is contained in:
commit
5ac5e7d5a6
2 changed files with 12 additions and 11 deletions
|
@ -28,8 +28,8 @@ struct sway_xwayland_surface {
|
||||||
struct wl_listener request_resize;
|
struct wl_listener request_resize;
|
||||||
struct wl_listener request_maximize;
|
struct wl_listener request_maximize;
|
||||||
struct wl_listener request_configure;
|
struct wl_listener request_configure;
|
||||||
struct wl_listener unmap_notify;
|
struct wl_listener unmap;
|
||||||
struct wl_listener map_notify;
|
struct wl_listener map;
|
||||||
struct wl_listener destroy;
|
struct wl_listener destroy;
|
||||||
|
|
||||||
int pending_width, pending_height;
|
int pending_width, pending_height;
|
||||||
|
|
|
@ -114,9 +114,10 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
|
||||||
sway_surface->view->surface = NULL;
|
sway_surface->view->surface = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 =
|
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_remove(&sway_surface->view->unmanaged_view_link);
|
||||||
wl_list_init(&sway_surface->view->unmanaged_view_link);
|
wl_list_init(&sway_surface->view->unmanaged_view_link);
|
||||||
container_view_destroy(sway_surface->view->swayc);
|
container_view_destroy(sway_surface->view->swayc);
|
||||||
|
@ -124,10 +125,10 @@ static void handle_unmap_notify(struct wl_listener *listener, void *data) {
|
||||||
sway_surface->view->surface = NULL;
|
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
|
// TODO put the view back into the tree
|
||||||
struct sway_xwayland_surface *sway_surface =
|
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;
|
struct wlr_xwayland_surface *xsurface = data;
|
||||||
|
|
||||||
sway_surface->view->surface = xsurface->surface;
|
sway_surface->view->surface = xsurface->surface;
|
||||||
|
@ -209,11 +210,11 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
|
||||||
&sway_surface->request_configure);
|
&sway_surface->request_configure);
|
||||||
sway_surface->request_configure.notify = handle_configure_request;
|
sway_surface->request_configure.notify = handle_configure_request;
|
||||||
|
|
||||||
wl_signal_add(&xsurface->events.unmap_notify, &sway_surface->unmap_notify);
|
wl_signal_add(&xsurface->events.unmap, &sway_surface->unmap);
|
||||||
sway_surface->unmap_notify.notify = handle_unmap_notify;
|
sway_surface->unmap.notify = handle_unmap;
|
||||||
|
|
||||||
wl_signal_add(&xsurface->events.map_notify, &sway_surface->map_notify);
|
wl_signal_add(&xsurface->events.map, &sway_surface->map);
|
||||||
sway_surface->map_notify.notify = handle_map_notify;
|
sway_surface->map.notify = handle_map;
|
||||||
|
|
||||||
handle_map_notify(&sway_surface->map_notify, xsurface);
|
handle_map(&sway_surface->map, xsurface);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue