aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-09-30 09:58:34 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-09-30 09:58:34 +0400
commitf381db8354f249d828c9cb030e1f39b2bd20bb00 (patch)
tree3ac264d61b92491f7fafe1e0957ee5b273cf8556 /src/backend
parentf7c390a320ef2e13777c26cea687226035c94f51 (diff)
downloadniri-f381db8354f249d828c9cb030e1f39b2bd20bb00.tar.gz
niri-f381db8354f249d828c9cb030e1f39b2bd20bb00.tar.bz2
niri-f381db8354f249d828c9cb030e1f39b2bd20bb00.zip
Make pipewire / xdp-gnome-screencast optional
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/mod.rs8
-rw-r--r--src/backend/tty.rs1
2 files changed, 6 insertions, 3 deletions
diff --git a/src/backend/mod.rs b/src/backend/mod.rs
index 6475cab1..0c27abd6 100644
--- a/src/backend/mod.rs
+++ b/src/backend/mod.rs
@@ -2,8 +2,6 @@ use std::collections::HashMap;
use std::sync::{Arc, Mutex};
use std::time::Duration;
-use smithay::backend::allocator::gbm::GbmDevice;
-use smithay::backend::drm::DrmDeviceFd;
use smithay::backend::renderer::gles::GlesRenderer;
use smithay::output::Output;
use smithay::wayland::dmabuf::DmabufFeedback;
@@ -93,7 +91,11 @@ impl Backend {
}
}
- pub fn gbm_device(&self) -> Option<GbmDevice<DrmDeviceFd>> {
+ #[cfg(feature = "xdp-gnome-screencast")]
+ pub fn gbm_device(
+ &self,
+ ) -> Option<smithay::backend::allocator::gbm::GbmDevice<smithay::backend::drm::DrmDeviceFd>>
+ {
match self {
Backend::Tty(tty) => tty.gbm_device(),
Backend::Winit(_) => None,
diff --git a/src/backend/tty.rs b/src/backend/tty.rs
index c4ac14e7..11595ef7 100644
--- a/src/backend/tty.rs
+++ b/src/backend/tty.rs
@@ -853,6 +853,7 @@ impl Tty {
self.connectors.clone()
}
+ #[cfg(feature = "xdp-gnome-screencast")]
pub fn gbm_device(&self) -> Option<GbmDevice<DrmDeviceFd>> {
self.output_device.as_ref().map(|d| d.gbm.clone())
}