diff options
author | Ronan Pigott <rpigott@berkeley.edu> | 2019-11-03 12:05:25 -0700 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-11-04 23:56:27 +0100 |
commit | eaee087c1705713cd957a4050b3734c27434cb78 (patch) | |
tree | 1f0d8b21a74982b1937318e2cf95854ac21f6b57 /sway | |
parent | d159b987442795fa4af5cc58fc0a6055a86aa735 (diff) |
seatop_default: handle focus for xwayland_unmanaged views
Diffstat (limited to 'sway')
-rw-r--r-- | sway/input/seatop_default.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sway/input/seatop_default.c b/sway/input/seatop_default.c index 088ba545..46d9a657 100644 --- a/sway/input/seatop_default.c +++ b/sway/input/seatop_default.c @@ -7,6 +7,9 @@ #include "sway/input/seat.h" #include "sway/tree/view.h" #include "log.h" +#if HAVE_XWAYLAND +#include "sway/xwayland.h" +#endif struct seatop_default_event { struct sway_node *previous_node; @@ -292,6 +295,21 @@ 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) { |