mirror of
https://github.com/wez/wezterm.git
synced 2024-11-22 22:42:48 +03:00
wayland: set_cursor: use exactly the caller-provided serial
Don't fallback to some other serial. In a new version of SCTK, it looks like the serial we pass should be the serial from the time we entered the surface, rather than the latest serial that we have. In practice, this commit uses None for the serial which seems to have better results, but may come back to haunt us until we upgrade to the latest SCTK. refs: https://github.com/wez/wezterm/issues/3334#issuecomment-1515141539
This commit is contained in:
parent
048e8dd1ba
commit
e204f8ba49
@ -341,21 +341,18 @@ impl PointerDispatcher {
|
||||
}
|
||||
|
||||
pub fn set_cursor(&self, names: &[&str], serial: Option<u32>) {
|
||||
let inner = self.inner.lock().unwrap();
|
||||
let serial = serial.unwrap_or(inner.serial);
|
||||
|
||||
if names.is_empty() {
|
||||
(*self.auto_pointer).set_cursor(0, None, 0, 0);
|
||||
} else {
|
||||
let mut errors = vec![];
|
||||
for name in names {
|
||||
match self.auto_pointer.set_cursor(name, Some(serial)) {
|
||||
match self.auto_pointer.set_cursor(name, serial) {
|
||||
Ok(_) => return,
|
||||
Err(err) => errors.push(format!("Unable to set cursor to {name}: {err:#}")),
|
||||
}
|
||||
}
|
||||
|
||||
if let Err(err) = self.auto_pointer.set_cursor("default", Some(serial)) {
|
||||
if let Err(err) = self.auto_pointer.set_cursor("default", serial) {
|
||||
errors.push(format!("Unable to set cursor to 'default': {err:#}"));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user