diff options
author | emersion <contact@emersion.fr> | 2018-03-30 10:09:56 -0400 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-03-30 10:09:56 -0400 |
commit | 28cb412b0d083355507875459e6c5f412e81ce43 (patch) | |
tree | e0b75ac21b94bf66d24d6aba1528fa6b1d195189 | |
parent | Cleanup and remove global renderer reference (diff) | |
download | sway-28cb412b0d083355507875459e6c5f412e81ce43.tar.gz sway-28cb412b0d083355507875459e6c5f412e81ce43.tar.zst sway-28cb412b0d083355507875459e6c5f412e81ce43.zip |
Unify initial xwayland view mapping with map handler
-rw-r--r-- | sway/desktop/xwayland.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 38ee4656..c3697b4c 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -150,7 +150,8 @@ static void handle_map_notify(struct wl_listener *listener, void *data) { | |||
150 | sway_surface->view->surface = xsurface->surface; | 150 | sway_surface->view->surface = xsurface->surface; |
151 | 151 | ||
152 | // put it back into the tree | 152 | // put it back into the tree |
153 | if (xsurface->override_redirect) { | 153 | if (wlr_xwayland_surface_is_unmanaged(xsurface) || |
154 | xsurface->override_redirect) { | ||
154 | wl_list_insert(&root_container.sway_root->unmanaged_views, | 155 | wl_list_insert(&root_container.sway_root->unmanaged_views, |
155 | &sway_surface->view->unmanaged_view_link); | 156 | &sway_surface->view->unmanaged_view_link); |
156 | } else { | 157 | } else { |
@@ -230,18 +231,5 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) { | |||
230 | wl_signal_add(&xsurface->events.map_notify, &sway_surface->map_notify); | 231 | wl_signal_add(&xsurface->events.map_notify, &sway_surface->map_notify); |
231 | sway_surface->map_notify.notify = handle_map_notify; | 232 | sway_surface->map_notify.notify = handle_map_notify; |
232 | 233 | ||
233 | if (wlr_xwayland_surface_is_unmanaged(xsurface)) { | 234 | handle_map_notify(&sway_surface->map_notify, xsurface); |
234 | // these don't get a container in the tree | ||
235 | wl_list_insert(&root_container.sway_root->unmanaged_views, | ||
236 | &sway_view->unmanaged_view_link); | ||
237 | return; | ||
238 | } | ||
239 | |||
240 | struct sway_seat *seat = input_manager_current_seat(input_manager); | ||
241 | struct sway_container *focus = sway_seat_get_focus_inactive(seat, &root_container); | ||
242 | struct sway_container *cont = container_view_create(focus, sway_view); | ||
243 | sway_view->swayc = cont; | ||
244 | |||
245 | arrange_windows(cont->parent, -1, -1); | ||
246 | sway_input_manager_set_focus(input_manager, cont); | ||
247 | } | 235 | } |