aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-04-07 14:03:30 -0400
committeremersion <contact@emersion.fr>2018-04-07 14:03:30 -0400
commit2b357af7eed9c7dd3a8f9b5bb589c352cabd6406 (patch)
tree7a56e757655bf8e8943cb277c81a3e89f724f9ce /sway/desktop
parenta5d06b6e2b52d535fca25adf143f27233a3609c5 (diff)
Give keyboard focus to unmanaged xwayland surfaces
This fixes dmenu
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/xwayland.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 6de1365d..413dbf8b 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -59,6 +59,13 @@ static void unmanaged_handle_map(struct wl_listener *listener, void *data) {
surface->ly = xsurface->y;
desktop_damage_surface(xsurface->surface, surface->lx, surface->ly, true);
+ if (!wlr_xwayland_surface_is_unmanaged(xsurface)) {
+ struct sway_seat *seat = input_manager_current_seat(input_manager);
+ struct wlr_xwayland *xwayland = seat->input->server->xwayland;
+ wlr_xwayland_set_seat(xwayland, seat->wlr_seat);
+ seat_set_focus_surface(seat, xsurface->surface);
+ }
+
// TODO: we don't send surface enter/leave events to xwayland unmanaged
// surfaces, but xwayland doesn't support HiDPI anyway
}