From 5671e49c9b2bf82a773f4c058a91726d0058cc87 Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Mon, 6 Jul 2026 19:07:11 -0700 Subject: [PATCH] wgpu: Apply Nvidia driver workaround regardless of `cctk` feature --- Cargo.lock | 5 +++-- Cargo.toml | 1 + wgpu/Cargo.toml | 1 + wgpu/src/window.rs | 1 - wgpu/src/window/compositor.rs | 12 ------------ wgpu/src/window/wayland.rs | 6 +++--- 6 files changed, 8 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 11a85d77..3fe192d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1294,7 +1294,7 @@ dependencies = [ [[package]] name = "cosmic-client-toolkit" version = "0.2.0" -source = "git+https://github.com/pop-os/cosmic-protocols?rev=a7d2d7a#a7d2d7a6188425f699eaddf7a025617ce56068ae" +source = "git+https://github.com/pop-os/cosmic-protocols?rev=32283d7#32283d76a8d0342da74c4cc022a533c52dcf378f" dependencies = [ "bitflags 2.11.0", "cosmic-protocols", @@ -1307,7 +1307,7 @@ dependencies = [ [[package]] name = "cosmic-protocols" version = "0.2.0" -source = "git+https://github.com/pop-os/cosmic-protocols?rev=a7d2d7a#a7d2d7a6188425f699eaddf7a025617ce56068ae" +source = "git+https://github.com/pop-os/cosmic-protocols?rev=32283d7#32283d76a8d0342da74c4cc022a533c52dcf378f" dependencies = [ "bitflags 2.11.0", "wayland-backend", @@ -3195,6 +3195,7 @@ dependencies = [ "resvg", "rustc-hash 2.1.2", "rustix 0.38.44", + "smithay-client-toolkit 0.20.0", "thiserror 2.0.18", "tiny-xlib", "wayland-backend", diff --git a/Cargo.toml b/Cargo.toml index 555f7901..0bbcfebe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -308,6 +308,7 @@ winit = { git = "https://github.com/pop-os/winit.git", tag = "cosmic-0.14" } winit-core = { git = "https://github.com/pop-os/winit.git", tag = "cosmic-0.14" } cursor-icon = "1.1.0" +sctk = { package = "smithay-client-toolkit", version = "0.20.0" } [workspace.lints.rust] rust_2018_idioms = { level = "deny", priority = -1 } diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index 48fca1b8..f347f363 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -65,3 +65,4 @@ x11rb = { version = "0.13.1", features = [ "dri3", "randr", ] } +sctk.workspace = true diff --git a/wgpu/src/window.rs b/wgpu/src/window.rs index b9ec54bd..385041c2 100644 --- a/wgpu/src/window.rs +++ b/wgpu/src/window.rs @@ -2,7 +2,6 @@ pub mod compositor; #[cfg(all( unix, - feature = "cctk", not(target_os = "macos"), not(target_os = "redox") ))] diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs index 58c7d713..2269b9b7 100644 --- a/wgpu/src/window/compositor.rs +++ b/wgpu/src/window/compositor.rs @@ -11,7 +11,6 @@ use crate::{Engine, Renderer}; #[cfg(all( unix, - feature = "cctk", not(target_os = "macos"), not(target_os = "redox") ))] @@ -67,7 +66,6 @@ impl Compositor { ) -> Result { #[cfg(all( unix, - feature = "cctk", not(target_os = "macos"), not(target_os = "redox") ))] @@ -76,16 +74,6 @@ impl Compositor { .or_else(|| get_x11_device_ids(window)) }); - #[cfg(all( - unix, - not(feature = "cctk"), - not(target_os = "macos"), - not(target_os = "redox") - ))] - let ids = compatible_window - .as_ref() - .and_then(|window| get_x11_device_ids(window)); - // HACK: // 1. If we specifically didn't select an nvidia gpu // 2. and the user didn't specifically request an nvidia gpu diff --git a/wgpu/src/window/wayland.rs b/wgpu/src/window/wayland.rs index 48e00def..af448d94 100644 --- a/wgpu/src/window/wayland.rs +++ b/wgpu/src/window/wayland.rs @@ -1,5 +1,5 @@ use crate::graphics::compositor::Window; -use cctk::sctk::{ +use sctk::{ dmabuf::{DmabufFeedback, DmabufHandler, DmabufState}, registry::{ProvidesRegistryState, RegistryState}, registry_handlers, @@ -111,5 +111,5 @@ pub fn get_wayland_device_ids(window: &W) -> Option<(u16, u16)> { } } -cctk::sctk::delegate_dmabuf!(AppData); -cctk::sctk::delegate_registry!(AppData); +sctk::delegate_dmabuf!(AppData); +sctk::delegate_registry!(AppData);