xwayland-unmanaged: handle focus on map/cursor button

This implements keyboard focus on map for unmanaged Xwayland views
using wlroot's heuristic approach as well as keyboard focus on cursor
button click.
This commit is contained in:
Zakariyya Von Forslun
2022-05-28 22:19:43 +10:00
committed by Isaac Freund
parent 0dd5ad032c
commit 7b554bde68
3 changed files with 33 additions and 7 deletions

View File

@ -315,7 +315,13 @@ fn handleButton(listener: *wl.Listener(*wlr.Pointer.event.Button), event: *wlr.P
self.seat.focus(null);
}
},
.xwayland_unmanaged => assert(build_options.xwayland),
.xwayland_unmanaged => |xwayland_unmanaged| {
if (build_options.xwayland) {
self.seat.setFocusRaw(.{ .xwayland_unmanaged = xwayland_unmanaged });
} else {
unreachable;
}
},
}
_ = self.seat.wlr_seat.pointerNotifyButton(event.time_msec, event.button, event.state);