Report an error when trying to open ui in linux::headless (#11952)

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2024-05-17 09:50:23 -06:00 committed by GitHub
parent 9d10969906
commit b890fa71ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 25 additions and 0 deletions

View file

@ -502,6 +502,13 @@ impl AppContext {
})
}
/// Returns Ok() if the platform supports opening windows.
/// This returns false (for example) on linux when we could
/// not establish a connection to X or Wayland.
pub fn can_open_windows(&self) -> anyhow::Result<()> {
self.platform.can_open_windows()
}
/// Instructs the platform to activate the application by bringing it to the foreground.
pub fn activate(&self, ignoring_other_apps: bool) {
self.platform.activate(ignoring_other_apps);