diff --git a/Cargo.toml b/Cargo.toml index 7dcd272..1ea8a12 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,6 +36,8 @@ features = ["fluent-system", "desktop-requester"] [features] default = ["wgpu"] wgpu = ["libcosmic/wgpu"] +# Debugging features +force-shm-screencopy = [] [profile.dev] # Not usable at opt-level 0, at least with software renderer diff --git a/src/wayland/buffer.rs b/src/wayland/buffer.rs index 37ccb19..5827314 100644 --- a/src/wayland/buffer.rs +++ b/src/wayland/buffer.rs @@ -114,7 +114,7 @@ impl AppData { } } - #[allow(dead_code)] + #[cfg(not(feature = "force-shm-screencopy"))] fn create_gbm_buffer( &self, format: u32, @@ -215,6 +215,7 @@ impl AppData { // XXX Handle other formats? let format = u32::from(wl_shm::Format::Abgr8888); + #[cfg(not(feature = "force-shm-screencopy"))] if let Some((_, modifiers)) = formats.dmabuf_formats.iter().find(|(f, _)| *f == format) { match self.create_gbm_buffer(format, formats.buffer_size, false) { Ok(Some(buffer)) => {