Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/backend/wayland/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use smithay_client_toolkit::{
delegate_compositor, delegate_keyboard, delegate_layer, delegate_output, delegate_pointer,
delegate_pointer_constraints, delegate_registry, delegate_relative_pointer, delegate_seat,
delegate_shm, delegate_xdg_shell, delegate_xdg_window,
delegate_shm, delegate_touch, delegate_xdg_shell, delegate_xdg_window,
};

use super::state::WaylandState;
Expand All @@ -15,6 +15,7 @@ delegate_layer!(WaylandState);
delegate_seat!(WaylandState);
delegate_keyboard!(WaylandState);
delegate_pointer!(WaylandState);
delegate_touch!(WaylandState);
delegate_pointer_constraints!(WaylandState);
delegate_relative_pointer!(WaylandState);
delegate_registry!(WaylandState);
Expand All @@ -36,4 +37,5 @@ mod seat;
mod shm;
#[cfg(tablet)]
mod tablet;
mod touch;
mod xdg;
18 changes: 18 additions & 0 deletions src/backend/wayland/handlers/seat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ impl SeatHandler for WaylandState {
}
}

if capability == Capability::Touch {
info!("Touch capability available");
match self.seat_state.get_touch(qh, &seat) {
Ok(touch) => {
debug!("Touch initialized");
self.touch = Some(touch);
}
Err(err) => {
warn!("Touch initialization failed: {}", err);
}
}
}

#[cfg(tablet)]
if let Some(manager) = &self.tablet_manager
&& self.tablet_seats.is_empty()
Expand All @@ -79,6 +92,11 @@ impl SeatHandler for WaylandState {
self.current_pointer_shape = None;
self.cursor_hidden = false;
}
if capability == Capability::Touch {
info!("Touch capability removed");
self.touch = None;
self.cancel_active_touch_sequence();
}
}

fn remove_seat(&mut self, _conn: &Connection, _qh: &QueueHandle<Self>, _seat: wl_seat::WlSeat) {
Expand Down
Loading
Loading