aboutsummaryrefslogtreecommitdiff
path: root/src/backend/mod.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-09-08 17:54:02 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-09-08 23:53:56 +0400
commitd52ca23caa4345ddf768da5af24f47eae6fd4738 (patch)
treec0e3f3f4c99b0dfd5bd739e349890081cba2187e /src/backend/mod.rs
parentbd0ecf917489a84efa51bb1272ca27039256fe21 (diff)
downloadniri-d52ca23caa4345ddf768da5af24f47eae6fd4738.tar.gz
niri-d52ca23caa4345ddf768da5af24f47eae6fd4738.tar.bz2
niri-d52ca23caa4345ddf768da5af24f47eae6fd4738.zip
Add initial monitor screencast portal impl
DmaBuf monitor screencasting through xdg-dekstop-portal-gnome! Somewhat limited currently, e.g. the cursor is always embedded. But gets most of the job done.
Diffstat (limited to 'src/backend/mod.rs')
-rw-r--r--src/backend/mod.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/backend/mod.rs b/src/backend/mod.rs
index 8a59e6f3..8473ccc2 100644
--- a/src/backend/mod.rs
+++ b/src/backend/mod.rs
@@ -1,3 +1,8 @@
+use std::collections::HashMap;
+use std::sync::{Arc, Mutex};
+
+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;
@@ -79,6 +84,20 @@ impl Backend {
}
}
+ pub fn connectors(&self) -> Arc<Mutex<HashMap<String, Output>>> {
+ match self {
+ Backend::Tty(tty) => tty.connectors(),
+ Backend::Winit(winit) => winit.connectors(),
+ }
+ }
+
+ pub fn gbm_device(&self) -> Option<GbmDevice<DrmDeviceFd>> {
+ match self {
+ Backend::Tty(tty) => tty.gbm_device(),
+ Backend::Winit(_) => None,
+ }
+ }
+
pub fn tty(&mut self) -> &mut Tty {
if let Self::Tty(v) = self {
v