aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Ronan Pigott <rpigott@berkeley.edu>2019-11-03 12:05:25 -0700
committerLibravatar Simon Ser <contact@emersion.fr>2019-11-04 23:56:27 +0100
commiteaee087c1705713cd957a4050b3734c27434cb78 (patch)
tree1f0d8b21a74982b1937318e2cf95854ac21f6b57 /sway
parentseatop_move_floating: make container respect pointer constraint (diff)
downloadsway-eaee087c1705713cd957a4050b3734c27434cb78.tar.gz
sway-eaee087c1705713cd957a4050b3734c27434cb78.tar.zst
sway-eaee087c1705713cd957a4050b3734c27434cb78.zip
seatop_default: handle focus for xwayland_unmanaged views
Diffstat (limited to 'sway')
-rw-r--r--sway/input/seatop_default.c18
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 @@
7#include "sway/input/seat.h" 7#include "sway/input/seat.h"
8#include "sway/tree/view.h" 8#include "sway/tree/view.h"
9#include "log.h" 9#include "log.h"
10#if HAVE_XWAYLAND
11#include "sway/xwayland.h"
12#endif
10 13
11struct seatop_default_event { 14struct seatop_default_event {
12 struct sway_node *previous_node; 15 struct sway_node *previous_node;
@@ -292,6 +295,21 @@ static void handle_button(struct sway_seat *seat, uint32_t time_msec,
292 return; 295 return;
293 } 296 }
294 297
298#if HAVE_XWAYLAND
299 // Handle clicking on xwayland unmanaged view
300 if (surface && wlr_surface_is_xwayland_surface(surface)) {
301 struct wlr_xwayland_surface *xsurface =
302 wlr_xwayland_surface_from_wlr_surface(surface);
303 if (wlr_xwayland_or_surface_wants_focus(xsurface)) {
304 struct wlr_xwayland *xwayland = server.xwayland.wlr_xwayland;
305 wlr_xwayland_set_seat(xwayland, seat->wlr_seat);
306 seat_set_focus_surface(seat, xsurface->surface, false);
307 }
308 seat_pointer_notify_button(seat, time_msec, button, state);
309 return;
310 }
311#endif
312
295 // Handle tiling resize via border 313 // Handle tiling resize via border
296 if (cont && resize_edge && button == BTN_LEFT && 314 if (cont && resize_edge && button == BTN_LEFT &&
297 state == WLR_BUTTON_PRESSED && !is_floating) { 315 state == WLR_BUTTON_PRESSED && !is_floating) {