wayland: improve mouse cursor resolution and diagnostics

Switch to using `xterm` rather than `text` for the name of the
xterm style I-beam mouse cursor, as that appears to be more
compatible across themes; the gnome theme aliases text -> xterm
via a symlink.

Improve error diagnostics in the case that no cursor is found.

refs: https://github.com/wez/wezterm/issues/532
This commit is contained in:
Wez Furlong committed 2021-08-01 13:47:24 -07:00
1 parent 887152a13d
commit ecc63e2e5d
3 files changed
+6 -4

No files matched your search

+2 -2
View File
@@ -1117,8 +1117,8 @@ fn change_pointer(pointer: &ThemedPointer, inner: &Inner, location: Location, se
_ => "left_ptr",
};
if pointer.set_cursor(name, serial).is_err() {
log::error!("Failed to set cursor");
if let Err(err) = pointer.set_cursor(name, serial) {
log::error!("Unable to set cursor to {}: {:#}", name, err);
}
}
+3 -1
View File
@@ -250,7 +250,9 @@ impl PointerDispatcher {
pub fn set_cursor(&self, name: &str, serial: Option<u32>) {
let inner = self.inner.lock().unwrap();
let serial = serial.unwrap_or(inner.serial);
self.auto_pointer.set_cursor(name, Some(serial)).ok();
if let Err(err) = self.auto_pointer.set_cursor(name, Some(serial)) {
log::error!("Unable to set cursor to {}: {:#}", name, err);
}
}
}
+1 -1
View File
@@ -897,7 +897,7 @@ impl WaylandWindowInner {
Some(MouseCursor::Hand) => "hand",
Some(MouseCursor::SizeUpDown) => "ns-resize",
Some(MouseCursor::SizeLeftRight) => "ew-resize",
Some(MouseCursor::Text) => "text",
Some(MouseCursor::Text) => "xterm",
None => return,
};
let conn = Connection::get().unwrap().wayland();