diff options
author | Ronan Pigott <rpigott@berkeley.edu> | 2019-11-05 12:21:06 -0700 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2019-11-08 19:06:00 -0500 |
commit | 37afbc4dbced99d008ec7014e75d65d37ff3adb3 (patch) | |
tree | 580b0d6686eadbdf0d7862bdae6405f8f7db1fa0 /sway | |
parent | f576bcdb8cb3ed1506ad03503815ad159c1c0479 (diff) |
seatop_default: handle focus for unmanaged xwayland windows last
Fixes #4707
Diffstat (limited to 'sway')
-rw-r--r-- | sway/input/seatop_default.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c index 46d9a657..3768bc63 100644 --- a/sway/input/seatop_default.c +++ b/sway/input/seatop_default.c @@ -295,21 +295,6 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec, return; } -#if HAVE_XWAYLAND - // Handle clicking on xwayland unmanaged view - if (surface && wlr_surface_is_xwayland_surface(surface)) { - struct wlr_xwayland_surface *xsurface = - wlr_xwayland_surface_from_wlr_surface(surface); - if (wlr_xwayland_or_surface_wants_focus(xsurface)) { - struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland; - wlr_xwayland_set_seat(xwayland, seat->wlr_seat); - seat_set_focus_surface(seat, xsurface->surface, false); - } - seat_pointer_notify_button(seat, time_msec, button, state); - return; - } -#endif - // Handle tiling resize via border if (cont && resize_edge && button == BTN_LEFT && state == WLR_BUTTON_PRESSED && !is_floating) { @@ -426,6 +411,22 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec, return; } +#if HAVE_XWAYLAND + // Handle clicking on xwayland unmanaged view + if (surface && wlr_surface_is_xwayland_surface(surface)) { + struct wlr_xwayland_surface *xsurface = + wlr_xwayland_surface_from_wlr_surface(surface); + if (xsurface->override_redirect && + wlr_xwayland_or_surface_wants_focus(xsurface)) { + struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland; + wlr_xwayland_set_seat(xwayland, seat->wlr_seat); + seat_set_focus_surface(seat, xsurface->surface, false); + seat_pointer_notify_button(seat, time_msec, button, state); + return; + } + } +#endif + seat_pointer_notify_button(seat, time_msec, button, state); } |