You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xcursor 0.3.7 just released and added an API that allows reading directly from a cursor file. The previously existing API could only read from an in-memory buffer, so the file had to be loaded into memory first and could then be parsed.
Basically, what I am trying to say is:
diff --git a/wayland-cursor/Cargo.toml b/wayland-cursor/Cargo.toml
index e940223d..51d8e05d 100644
--- a/wayland-cursor/Cargo.toml+++ b/wayland-cursor/Cargo.toml@@ -14,7 +14,7 @@ readme = "README.md"
[dependencies]
wayland-client = { version = "0.31.5", path = "../wayland-client" }
-xcursor = "0.3.1"+xcursor = "0.3.7"
rustix = { version = "0.38.15", features = ["shm"] }
[package.metadata.docs.rs]
diff --git a/wayland-cursor/src/lib.rs b/wayland-cursor/src/lib.rs
index bc1751f8..e335cd79 100644
--- a/wayland-cursor/src/lib.rs+++ b/wayland-cursor/src/lib.rs@@ -49,7 +49,7 @@ use std::borrow::Cow;
use std::env;
use std::fmt::Debug;
use std::fs::File;
-use std::io::{Error as IoError, Read, Result as IoResult, Seek, SeekFrom, Write};+use std::io::{BufReader, Error as IoError, Result as IoResult, Seek, SeekFrom, Write};
use std::ops::{Deref, Index};
use std::os::unix::io::{AsFd, OwnedFd};
use std::sync::Arc;
@@ -243,13 +243,9 @@ impl CursorTheme {
fn load_cursor(&mut self, name: &str, size: u32) -> Option<Cursor> {
let conn = Connection::from_backend(self.backend.upgrade()?);
let icon_path = XCursorTheme::load(&self.name).load_icon(name)?;
- let mut icon_file = File::open(icon_path).ok()?;+ let mut icon_file = BufReader::new(File::open(icon_path).ok()?);- let mut buf = Vec::new();- let images = {- icon_file.read_to_end(&mut buf).ok()?;- xparser::parse_xcursor(&buf)?- };+ let images = xparser::parse_xcursor_stream(&mut icon_file).ok()?;
Some(Cursor::new(&conn, name, self, &images, size))
}
I don't know about your version policy and I am too lazy to fork, so I am just leaving this here for your information. Feel free to just close this issue if this does not seem important to you.
The text was updated successfully, but these errors were encountered:
Hi there,
xcursor 0.3.7 just released and added an API that allows reading directly from a cursor file. The previously existing API could only read from an in-memory buffer, so the file had to be loaded into memory first and could then be parsed.
Basically, what I am trying to say is:
I don't know about your version policy and I am too lazy to fork, so I am just leaving this here for your information. Feel free to just close this issue if this does not seem important to you.
The text was updated successfully, but these errors were encountered: