summaryrefslogtreecommitdiffstats
path: root/sway/desktop/xwayland.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r--sway/desktop/xwayland.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 75bfb7b2..6447b711 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -77,6 +77,21 @@ static void unmanaged_handle_unmap(struct wl_listener *listener, void *data) {
77 desktop_damage_surface(xsurface->surface, xsurface->x, xsurface->y, true); 77 desktop_damage_surface(xsurface->surface, xsurface->x, xsurface->y, true);
78 wl_list_remove(&surface->link); 78 wl_list_remove(&surface->link);
79 wl_list_remove(&surface->commit.link); 79 wl_list_remove(&surface->commit.link);
80
81 if (!wlr_xwayland_surface_is_unmanaged(xsurface)) {
82 struct sway_seat *seat = input_manager_current_seat(input_manager);
83 if (seat->wlr_seat->keyboard_state.focused_surface ==
84 xsurface->surface) {
85 // Restore focus
86 struct sway_container *previous =
87 seat_get_focus_inactive(seat, &root_container);
88 if (previous) {
89 // Hack to get seat to re-focus the return value of get_focus
90 seat_set_focus(seat, previous->parent);
91 seat_set_focus(seat, previous);
92 }
93 }
94 }
80} 95}
81 96
82static void unmanaged_handle_destroy(struct wl_listener *listener, void *data) { 97static void unmanaged_handle_destroy(struct wl_listener *listener, void *data) {