Fix clipboard not working when seat has empty name

This commit is contained in:
Kirill Chibisov 2020-07-10 21:35:02 +03:00 committed by Victor Berger
parent e497d7f526
commit f4abc24f11
3 changed files with 6 additions and 4 deletions

View file

@ -2,6 +2,8 @@
## Unreleased ## Unreleased
- Fixed clipboard not working, when seat had empty name
# 0.5.0 -- 2020-05-20 # 0.5.0 -- 2020-05-20
- Minimal rust version was bumped to 1.41.0 - Minimal rust version was bumped to 1.41.0

View file

@ -10,8 +10,8 @@ license = "MIT"
keywords = ["clipboard", "wayland"] keywords = ["clipboard", "wayland"]
[dependencies] [dependencies]
sctk = { package = "smithay-client-toolkit", version = "0.9.1", default-features = false } sctk = { package = "smithay-client-toolkit", version = "0.10", default-features = false }
wayland-client = { version = "0.26.3", features = ["dlopen"] } wayland-client = { version = "0.27", features = ["dlopen"] }
[dev-dependencies] [dev-dependencies]
sctk = { package = "smithay-client-toolkit", version = "0.9.1"} sctk = { package = "smithay-client-toolkit", version = "0.10"}

View file

@ -144,7 +144,7 @@ fn worker_impl(display: Display, request_rx: Receiver<Command>, reply_tx: Sender
// Listen for seats. // Listen for seats.
let _listener = env.listen_for_seats(move |seat, seat_data, _| { let _listener = env.listen_for_seats(move |seat, seat_data, _| {
let detached_seat = seat.clone().detach(); let detached_seat = seat.detach();
let pos = seats.iter().position(|st| st.seat == detached_seat); let pos = seats.iter().position(|st| st.seat == detached_seat);
let index = pos.unwrap_or_else(|| { let index = pos.unwrap_or_else(|| {
seats.push(SeatData::new(detached_seat, None, None)); seats.push(SeatData::new(detached_seat, None, None));