Add force-shm-screencopy feature for debugging
This commit is contained in:
parent
a2493fc90e
commit
1fc416bb2e
2 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue