Add set_keyring_label (#64)

This commit is contained in:
Andreas Johansson
2026-06-15 18:46:45 -04:00
committed by GitHub
parent ec395ac14c
commit 3cc78b38f4
5 changed files with 211 additions and 5 deletions
+6
View File
@@ -1129,6 +1129,12 @@ impl App {
self.platform.set_gpu_requirements(requirements);
}
/// Sets the label applied to credentials stored in the system keyring.
/// Call before writing credentials. Only Linux/FreeBSD apply the label.
pub fn set_keyring_label(&self, label: impl Into<SharedString>) {
self.platform.set_keyring_label(label.into());
}
/// Returns a handle to the window that is currently focused at the platform level, if one exists.
pub fn active_window(&self) -> Option<AnyWindowHandle> {
self.platform.active_window()
+4
View File
@@ -248,6 +248,10 @@ pub trait Platform: 'static {
/// `gpui_wgpu::WgpuDeviceRequirements`.
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
fn set_gpu_requirements(&self, _requirements: Box<dyn std::any::Any>) {}
/// Sets the label applied to credentials stored in the system keyring.
/// Only Linux/FreeBSD use this label.
fn set_keyring_label(&self, _label: SharedString) {}
}
/// A handle to a platform's display, e.g. a monitor or laptop screen.