aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Simon Ser <contact@emersion.fr>2021-03-12 09:44:22 +0100
committerLibravatar Kenny Levinsen <kl@kl.wtf>2021-03-12 10:52:12 +0100
commit585abdb3575176ef3cee462a83b69255c02de8f6 (patch)
tree0c17445ebfce422895e8e69b3bc2dfea09a76e52
parentoutput: simplify layer surface iteration (diff)
downloadsway-585abdb3575176ef3cee462a83b69255c02de8f6.tar.gz
sway-585abdb3575176ef3cee462a83b69255c02de8f6.tar.zst
sway-585abdb3575176ef3cee462a83b69255c02de8f6.zip
xwayland: simplify override-redirect focus restoration
No need to grab the xwayland surface from the wlr_surface, the parent is already an xwayland surface.
-rw-r--r--sway/desktop/xwayland.c12
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) {
105 if (seat->wlr_seat->keyboard_state.focused_surface == xsurface->surface) { 105 if (seat->wlr_seat->keyboard_state.focused_surface == xsurface->surface) {
106 // This simply returns focus to the parent surface if there's one available. 106 // This simply returns focus to the parent surface if there's one available.
107 // This seems to handle JetBrains issues. 107 // This seems to handle JetBrains issues.
108 if (xsurface->parent && xsurface->parent->surface && 108 if (xsurface->parent && xsurface->parent->surface
109 wlr_surface_is_xwayland_surface(xsurface->parent->surface)) { 109 && wlr_xwayland_or_surface_wants_focus(xsurface->parent)) {
110 struct wlr_xwayland_surface *next_surface = 110 seat_set_focus_surface(seat, xsurface->parent->surface, false);
111 wlr_xwayland_surface_from_wlr_surface(xsurface->parent->surface); 111 return;
112 if (wlr_xwayland_or_surface_wants_focus(next_surface)) {
113 seat_set_focus_surface(seat, xsurface->parent->surface, false);
114 return;
115 }
116 } 112 }
117 113
118 // Restore focus 114 // Restore focus