From bf7958d53de54bffb3c7f6715673364b7a726edb Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Mon, 25 Sep 2023 13:28:57 -0700 Subject: [PATCH] Update `wayland-rs` to 0.31, `smithay-client-toolkit`, etc. --- Cargo.toml | 18 +++++++++--------- client-toolkit/Cargo.toml | 22 +++++++++++----------- client-toolkit/examples/iced-capture.rs | 8 +++++--- examples/screenshot-export-dmabuf.rs | 15 +++++++-------- examples/screenshot-screencopy.rs | 4 ++-- 5 files changed, 34 insertions(+), 33 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 93c27ff675..a9f6c9dd4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,20 +12,20 @@ categories = ["gui", "api-bindings"] readme = "README.md" [dependencies] -wayland-scanner = "0.30.0" -wayland-backend = "0.1.0" -wayland-protocols = "0.30.0" -wayland-client = { version = "0.30.1", optional = true } -wayland-server = { version = "0.30.0", optional = true } -bitflags = "1.0" +wayland-scanner = "0.31.0" +wayland-backend = "0.3.1" +wayland-protocols = "0.31.0" +wayland-client = { version = "0.31.1", optional = true } +wayland-server = { version = "0.31.0", optional = true } +bitflags = "2.4" [dev-dependencies] async-channel = "1.7.1" cascade = "1" -env_logger = "0.9.1" +env_logger = "0.10.0" png = "0.17.5" -smithay = { git = "https://github.com/Smithay/smithay", rev = "c35bc3e", default-features = false, features = ["backend_egl", "renderer_gl", "renderer_multi"]} -wayland-backend = { version = "0.1.0", features = ["client_system"] } +smithay = { git = "https://github.com/Smithay/smithay", rev = "298a3ec", default-features = false, features = ["backend_egl", "renderer_gl", "renderer_multi"]} +wayland-backend = { version = "0.3.1", features = ["client_system"] } memfd = "0.6.1" [features] diff --git a/client-toolkit/Cargo.toml b/client-toolkit/Cargo.toml index ed31c32c69..4761fbfefc 100644 --- a/client-toolkit/Cargo.toml +++ b/client-toolkit/Cargo.toml @@ -5,8 +5,8 @@ edition = "2021" [dependencies] cosmic-protocols = { path = "../" } -sctk = { package = "smithay-client-toolkit", git = "https://github.com/smithay/client-toolkit", rev = "c9940f4" } -wayland-client = { version = "0.30.1" } +sctk = { package = "smithay-client-toolkit", git = "https://github.com/smithay/client-toolkit", rev = "dc8c4a0" } +wayland-client = { version = "0.31.1" } smithay = { git = "https://github.com/Smithay/smithay", rev = "c35bc3e", default-features = false, features = ["backend_egl", "renderer_gl", "renderer_multi"], optional = true } [build-dependencies] @@ -15,17 +15,17 @@ gl_generator = { version = "0.14.0", optional = true } [dev-dependencies] futures = "0.3.24" cascade = "1" -env_logger = "0.9.1" -gdk-pixbuf = "0.17.0" -glow = "0.11.2" +env_logger = "0.10.0" +gdk-pixbuf = "0.18.0" +glow = "0.12.0" glutin = "0.30.0" -gtk4 = { version = "0.6.4", features = ["v4_6"] } -gdk4-wayland = { version = "0.6.3", features = ["wayland_crate", "v4_4", "egl"] } -iced = { version = "0.5.2", features = ["image"] } -nix = "0.25.0" +gtk4 = { version = "0.7.3", features = ["v4_6"] } +gdk4-wayland = { version = "0.7.2", features = ["wayland_crate", "v4_4", "egl"] } +iced = { version = "0.10.0", features = ["image"] } +nix = { version = "0.27.0", features = ["fs"] } raw-window-handle = "0.5.0" -wayland-backend = { version = "0.1.0", features = ["client_system"] } -winit = "0.27.4" +wayland-backend = { version = "0.3.2", features = ["client_system"] } +winit = "0.28.0" [features] default = [] diff --git a/client-toolkit/examples/iced-capture.rs b/client-toolkit/examples/iced-capture.rs index d4b16cd600..7957d57f6f 100644 --- a/client-toolkit/examples/iced-capture.rs +++ b/client-toolkit/examples/iced-capture.rs @@ -349,9 +349,11 @@ impl iced::Application for App { }), ); let output_subscription = - iced::subscription::run("output-img", output_img_stream.map(Message::Image)); - let workspace_subscription = - iced::subscription::run("workspace-img", workspace_img_stream.map(Message::Image)); + iced::subscription::run_with_id("output-img", output_img_stream.map(Message::Image)); + let workspace_subscription = iced::subscription::run_with_id( + "workspace-img", + workspace_img_stream.map(Message::Image), + ); iced::Subscription::batch([output_subscription, workspace_subscription]) } } diff --git a/examples/screenshot-export-dmabuf.rs b/examples/screenshot-export-dmabuf.rs index b4e349f7e1..696513fa45 100644 --- a/examples/screenshot-export-dmabuf.rs +++ b/examples/screenshot-export-dmabuf.rs @@ -9,7 +9,7 @@ use smithay::{ }, drm::node::DrmNode, renderer::{ - gles2::{Gles2Renderer, Gles2Texture}, + gles::GlesRenderer, multigpu::{egl::EglGlesBackend, GpuManager}, Bind, ExportMem, }, @@ -123,7 +123,7 @@ impl Dispatch, ) { - let mut frame = app_data.frames.entry(output_name.clone()).or_default(); + let frame = app_data.frames.entry(output_name.clone()).or_default(); match event { zcosmic_export_dmabuf_frame_v1::Event::Device { ref node } => { @@ -193,8 +193,7 @@ fn main() { event_queue.blocking_dispatch(&mut app_data).unwrap(); } - let mut gpu_manager = - GpuManager::new(EglGlesBackend::::default(), None).unwrap(); + let mut gpu_manager = GpuManager::new(EglGlesBackend::::default()).unwrap(); for (k, v) in app_data.frames { let mut builder = Dmabuf::builder( @@ -214,15 +213,15 @@ fn main() { let dmabuf = builder.build().unwrap(); let drm_node = v.node.as_ref().unwrap(); - let mut renderer = gpu_manager - .renderer::(drm_node, drm_node) - .unwrap(); + let mut renderer = gpu_manager.single_renderer(drm_node).unwrap(); renderer.bind(dmabuf).unwrap(); let rectangle = Rectangle { loc: Point::default(), size: Size::from((v.width as i32, v.height as i32)), }; - let mapping = renderer.copy_framebuffer(rectangle).unwrap(); + let mapping = renderer + .copy_framebuffer(rectangle, Fourcc::Argb8888) + .unwrap(); let data = renderer.map_texture(&mapping).unwrap(); let path = format!("{}.png", k); diff --git a/examples/screenshot-screencopy.rs b/examples/screenshot-screencopy.rs index dda2e59735..c896f3013f 100644 --- a/examples/screenshot-screencopy.rs +++ b/examples/screenshot-screencopy.rs @@ -6,7 +6,7 @@ use std::{ collections::HashMap, fs, io::{self, Read, Seek, SeekFrom}, - os::unix::io::AsRawFd, + os::unix::io::AsFd, }; use wayland_client::{ protocol::{ @@ -188,7 +188,7 @@ impl Dispatch .set_len(size.0 as u64 * size.1 as u64 * 4) .expect("Failed to resize memfd"); let pool = app_data.wl_shm.as_ref().unwrap().create_pool( - fd.as_raw_fd(), + fd.as_file().as_fd(), (size.0 * size.1 * 4) as i32, qh, (),