mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-03-07 11:59:59 +03:00
recreate wl_{pointer,keyboard} on capability event (#222)
this should fix #88 fixes #123
This commit is contained in:
committed by
GitHub
parent
7496015d8d
commit
e7a18b9696
@@ -648,10 +648,16 @@ impl Dispatch<wl_seat::WlSeat, ()> for State {
|
||||
capabilities: WEnum::Value(capabilities),
|
||||
} = event
|
||||
{
|
||||
if capabilities.contains(wl_seat::Capability::Pointer) && state.pointer.is_none() {
|
||||
if capabilities.contains(wl_seat::Capability::Pointer) {
|
||||
if let Some(p) = state.pointer.take() {
|
||||
p.release();
|
||||
}
|
||||
state.pointer.replace(seat.get_pointer(qh, ()));
|
||||
}
|
||||
if capabilities.contains(wl_seat::Capability::Keyboard) && state.keyboard.is_none() {
|
||||
if capabilities.contains(wl_seat::Capability::Keyboard) {
|
||||
if let Some(k) = state.keyboard.take() {
|
||||
k.release();
|
||||
}
|
||||
seat.get_keyboard(qh, ());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user