diff options
author | Simon Ser <contact@emersion.fr> | 2021-03-12 09:44:22 +0100 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2021-03-12 10:52:12 +0100 |
commit | 585abdb3575176ef3cee462a83b69255c02de8f6 (patch) | |
tree | 0c17445ebfce422895e8e69b3bc2dfea09a76e52 /sway/desktop | |
parent | ba6c0eb18bd87938c7fba72236129c9ba949b007 (diff) |
xwayland: simplify override-redirect focus restoration
No need to grab the xwayland surface from the wlr_surface, the
parent is already an xwayland surface.
Diffstat (limited to 'sway/desktop')
-rw-r--r-- | sway/desktop/xwayland.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 14a93982..66cb3b02 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -105,14 +105,10 @@ static void unmanaged_handle_unmap(struct wl_listener *listener, void *data) { if (seat->wlr_seat->keyboard_state.focused_surface == xsurface->surface) { // This simply returns focus to the parent surface if there's one available. // This seems to handle JetBrains issues. - if (xsurface->parent && xsurface->parent->surface && - wlr_surface_is_xwayland_surface(xsurface->parent->surface)) { - struct wlr_xwayland_surface *next_surface = - wlr_xwayland_surface_from_wlr_surface(xsurface->parent->surface); - if (wlr_xwayland_or_surface_wants_focus(next_surface)) { - seat_set_focus_surface(seat, xsurface->parent->surface, false); - return; - } + if (xsurface->parent && xsurface->parent->surface + && wlr_xwayland_or_surface_wants_focus(xsurface->parent)) { + seat_set_focus_surface(seat, xsurface->parent->surface, false); + return; } // Restore focus |