Update wayland deps (#199)

Co-authored-by: Antonino Siena <a.siena@gmx.de>
This commit is contained in:
Antonino Siena 2020-07-09 21:21:16 +02:00 committed by GitHub
parent d33084f860
commit 49004f4380
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 11 deletions

View file

@ -44,9 +44,9 @@ x11 = ["x11-dl", "xkb", "xkbcommon-sys"]
wayland = ["wayland-client", "wayland-protocols", "wayland-cursor", "tempfile", "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] [target.'cfg(not(any(target_os = "macos", target_os = "redox", windows)))'.dependencies]
wayland-client = {version = "0.25", optional = true} wayland-client = {version = "0.27", optional = true}
wayland-protocols = { version = "0.25", features = ["client", "unstable_protocols"], optional = true } wayland-protocols = { version = "0.27", features = ["client", "unstable_protocols"], optional = true }
wayland-cursor = {version = "0.25", optional = true} wayland-cursor = {version = "0.27", optional = true}
tempfile = {version = "3.1.0", optional = true} tempfile = {version = "3.1.0", optional = true}
xkb = {version = "0.2.1", optional = true} xkb = {version = "0.2.1", optional = true}
xkbcommon-sys = {version = "0.7", optional = true} xkbcommon-sys = {version = "0.7", optional = true}

View file

@ -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(); let cursor_surface = compositor.create_surface();
Ok(( Ok((
@ -365,13 +365,11 @@ impl DisplayInfo {
fn update_cursor(&mut self, cursor: &str) -> std::result::Result<(), ()> { fn update_cursor(&mut self, cursor: &str) -> std::result::Result<(), ()> {
let cursor = self.cursor.get_cursor(cursor); let cursor = self.cursor.get_cursor(cursor);
if let Some(cursor) = cursor { if let Some(cursor) = cursor {
let img = cursor.frame_buffer(0); let img = &cursor[0];
if let Some(img) = img { self.cursor_surface.attach(Some(&*img), 0, 0);
self.cursor_surface.attach(Some(&*img), 0, 0); self.cursor_surface.damage(0, 0, 32, 32);
self.cursor_surface.damage(0, 0, 32, 32); self.cursor_surface.commit();
self.cursor_surface.commit(); return Ok(());
return Ok(());
}
} }
Err(()) Err(())
} }