mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2024-12-23 19:31:30 +11:00
Update wayland deps (#199)
Co-authored-by: Antonino Siena <a.siena@gmx.de>
This commit is contained in:
parent
d33084f860
commit
49004f4380
|
@ -44,9 +44,9 @@ x11 = ["x11-dl", "xkb", "xkbcommon-sys"]
|
|||
wayland = ["wayland-client", "wayland-protocols", "wayland-cursor", "tempfile", "xkb", "xkbcommon-sys"]
|
||||
|
||||
[target.'cfg(not(any(target_os = "macos", target_os = "redox", windows)))'.dependencies]
|
||||
wayland-client = {version = "0.25", optional = true}
|
||||
wayland-protocols = { version = "0.25", features = ["client", "unstable_protocols"], optional = true }
|
||||
wayland-cursor = {version = "0.25", optional = true}
|
||||
wayland-client = {version = "0.27", optional = true}
|
||||
wayland-protocols = { version = "0.27", features = ["client", "unstable_protocols"], optional = true }
|
||||
wayland-cursor = {version = "0.27", optional = true}
|
||||
tempfile = {version = "3.1.0", optional = true}
|
||||
xkb = {version = "0.2.1", optional = true}
|
||||
xkbcommon-sys = {version = "0.7", optional = true}
|
||||
|
|
|
@ -327,7 +327,7 @@ impl DisplayInfo {
|
|||
}
|
||||
});
|
||||
|
||||
let cursor = wayland_cursor::load_theme(None, 16, &shm);
|
||||
let cursor = wayland_cursor::CursorTheme::load(16, &shm);
|
||||
let cursor_surface = compositor.create_surface();
|
||||
|
||||
Ok((
|
||||
|
@ -365,13 +365,11 @@ impl DisplayInfo {
|
|||
fn update_cursor(&mut self, cursor: &str) -> std::result::Result<(), ()> {
|
||||
let cursor = self.cursor.get_cursor(cursor);
|
||||
if let Some(cursor) = cursor {
|
||||
let img = cursor.frame_buffer(0);
|
||||
if let Some(img) = img {
|
||||
self.cursor_surface.attach(Some(&*img), 0, 0);
|
||||
self.cursor_surface.damage(0, 0, 32, 32);
|
||||
self.cursor_surface.commit();
|
||||
return Ok(());
|
||||
}
|
||||
let img = &cursor[0];
|
||||
self.cursor_surface.attach(Some(&*img), 0, 0);
|
||||
self.cursor_surface.damage(0, 0, 32, 32);
|
||||
self.cursor_surface.commit();
|
||||
return Ok(());
|
||||
}
|
||||
Err(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue