aboutsummaryrefslogtreecommitdiff
path: root/src/gui/utils.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/utils.rs')
-rw-r--r--src/gui/utils.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/utils.rs b/src/gui/utils.rs
new file mode 100644
index 0000000..673b96e
--- /dev/null
+++ b/src/gui/utils.rs
@@ -0,0 +1,9 @@
+use std::future::Future;
+
+/// Spawns a task on the default executor, without waiting for it to complete
+pub fn spawn<F>(future: F)
+where
+ F: Future<Output = ()> + 'static,
+{
+ gtk4::glib::MainContext::default().spawn_local(future);
+}