aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/mod.rs2
-rw-r--r--src/backend/tty.rs8
-rw-r--r--src/backend/winit.rs6
-rw-r--r--src/config_error_notification.rs6
-rw-r--r--src/handlers/mod.rs11
5 files changed, 18 insertions, 15 deletions
diff --git a/src/backend/mod.rs b/src/backend/mod.rs
index f829bba1..ec00b10b 100644
--- a/src/backend/mod.rs
+++ b/src/backend/mod.rs
@@ -98,7 +98,7 @@ impl Backend {
}
}
- pub fn import_dmabuf(&mut self, dmabuf: &Dmabuf) -> Result<(), ()> {
+ pub fn import_dmabuf(&mut self, dmabuf: &Dmabuf) -> bool {
match self {
Backend::Tty(tty) => tty.import_dmabuf(dmabuf),
Backend::Winit(winit) => winit.import_dmabuf(dmabuf),
diff --git a/src/backend/tty.rs b/src/backend/tty.rs
index 9e9fd623..ca211c0d 100644
--- a/src/backend/tty.rs
+++ b/src/backend/tty.rs
@@ -1113,20 +1113,20 @@ impl Tty {
}
}
- pub fn import_dmabuf(&mut self, dmabuf: &Dmabuf) -> Result<(), ()> {
+ pub fn import_dmabuf(&mut self, dmabuf: &Dmabuf) -> bool {
let mut renderer = match self.gpu_manager.single_renderer(&self.primary_render_node) {
Ok(renderer) => renderer,
Err(err) => {
debug!("error creating renderer for primary GPU: {err:?}");
- return Err(());
+ return false;
}
};
match renderer.import_dmabuf(dmabuf, None) {
- Ok(_texture) => Ok(()),
+ Ok(_texture) => true,
Err(err) => {
debug!("error importing dmabuf: {err:?}");
- Err(())
+ false
}
}
}
diff --git a/src/backend/winit.rs b/src/backend/winit.rs
index 88de99b2..7f35e153 100644
--- a/src/backend/winit.rs
+++ b/src/backend/winit.rs
@@ -211,12 +211,12 @@ impl Winit {
renderer.set_debug_flags(renderer.debug_flags() ^ DebugFlags::TINT);
}
- pub fn import_dmabuf(&mut self, dmabuf: &Dmabuf) -> Result<(), ()> {
+ pub fn import_dmabuf(&mut self, dmabuf: &Dmabuf) -> bool {
match self.backend.renderer().import_dmabuf(dmabuf, None) {
- Ok(_texture) => Ok(()),
+ Ok(_texture) => true,
Err(err) => {
debug!("error importing dmabuf: {err:?}");
- Err(())
+ false
}
}
}
diff --git a/src/config_error_notification.rs b/src/config_error_notification.rs
index 773f3a13..c4f314ca 100644
--- a/src/config_error_notification.rs
+++ b/src/config_error_notification.rs
@@ -167,6 +167,12 @@ impl ConfigErrorNotification {
}
}
+impl Default for ConfigErrorNotification {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
fn render(scale: i32, created_path: Option<&Path>) -> anyhow::Result<MemoryRenderBuffer> {
let _span = tracy_client::span!("config_error_notification::render");
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs
index 0ca5e7bb..07fb1a64 100644
--- a/src/handlers/mod.rs
+++ b/src/handlers/mod.rs
@@ -229,13 +229,10 @@ impl DmabufHandler for State {
dmabuf: Dmabuf,
notifier: ImportNotifier,
) {
- match self.backend.import_dmabuf(&dmabuf) {
- Ok(_) => {
- let _ = notifier.successful::<State>();
- }
- Err(_) => {
- notifier.failed();
- }
+ if self.backend.import_dmabuf(&dmabuf) {
+ let _ = notifier.successful::<State>();
+ } else {
+ notifier.failed();
}
}
}