diff options
author | emersion <contact@emersion.fr> | 2018-04-12 23:30:06 -0400 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-04-13 14:37:13 +0200 |
commit | fa02e30adf06e5b2ff661c1271b93851f13337ce (patch) | |
tree | 44a6f14090ec82f17f0d38c210a56c57c0facf21 /rootston | |
parent | 8dec7036d0c63585f05b255ae46f8af56456abf8 (diff) |
xwayland: emit new_surface when unmapped
Diffstat (limited to 'rootston')
-rw-r--r-- | rootston/xwayland.c | 48 |
1 files changed, 20 insertions, 28 deletions
diff --git a/rootston/xwayland.c b/rootston/xwayland.c index 27a27b65..b7dbab54 100644 --- a/rootston/xwayland.c +++ b/rootston/xwayland.c @@ -228,19 +228,31 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) { static void handle_map(struct wl_listener *listener, void *data) { struct roots_xwayland_surface *roots_surface = wl_container_of(listener, roots_surface, map); - struct wlr_xwayland_surface *xsurface = data; + struct wlr_xwayland_surface *surface = data; struct roots_view *view = roots_surface->view; - view->x = xsurface->x; - view->y = xsurface->y; - view->width = xsurface->surface->current->width; - view->height = xsurface->surface->current->height; - - view_map(view, xsurface->surface); + view->x = surface->x; + view->y = surface->y; + view->width = surface->surface->current->width; + view->height = surface->surface->current->height; roots_surface->surface_commit.notify = handle_surface_commit; - wl_signal_add(&xsurface->surface->events.commit, + wl_signal_add(&surface->surface->events.commit, &roots_surface->surface_commit); + + view_map(view, surface->surface); + + if (!surface->override_redirect) { + if (surface->decorations == WLR_XWAYLAND_SURFACE_DECORATIONS_ALL) { + view->decorated = true; + view->border_width = 4; + view->titlebar_height = 12; + } + + view_setup(view); + } else { + view_initial_focus(view); + } } static void handle_unmap(struct wl_listener *listener, void *data) { @@ -289,10 +301,6 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) { wl_signal_add(&surface->events.request_fullscreen, &roots_surface->request_fullscreen); - roots_surface->surface_commit.notify = handle_surface_commit; - wl_signal_add(&surface->surface->events.commit, - &roots_surface->surface_commit); - struct roots_view *view = view_create(desktop); if (view == NULL) { free(roots_surface); @@ -301,8 +309,6 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) { view->type = ROOTS_XWAYLAND_VIEW; view->x = (double)surface->x; view->y = (double)surface->y; - view->width = surface->surface->current->width; - view->height = surface->surface->current->height; view->xwayland_surface = surface; view->roots_xwayland_surface = roots_surface; @@ -315,18 +321,4 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) { view->close = close; view->destroy = destroy; roots_surface->view = view; - - view_map(view, surface->surface); - - if (!surface->override_redirect) { - if (surface->decorations == WLR_XWAYLAND_SURFACE_DECORATIONS_ALL) { - view->decorated = true; - view->border_width = 4; - view->titlebar_height = 12; - } - - view_setup(view); - } else { - view_initial_focus(view); - } } |