From 291087037177fcb7756eedd0bf184fa197bc38b0 Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Sun, 9 Aug 2026 15:37:38 +0800 Subject: [PATCH] fix: expose display compositor availability --- crates/gpapi/src/utils/window.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/gpapi/src/utils/window.rs b/crates/gpapi/src/utils/window.rs index 5cc7f9c..cc748da 100644 --- a/crates/gpapi/src/utils/window.rs +++ b/crates/gpapi/src/utils/window.rs @@ -7,6 +7,11 @@ pub enum WindowTypeHint { Utility, } +#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))] +pub fn is_screen_composited() -> bool { + gtk::gdk::Screen::default().is_some_and(|screen| screen.is_composited()) +} + #[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))] pub fn set_window_type_hint(window: &WebviewWindow, hint: WindowTypeHint) -> anyhow::Result<()> { use gtk::{gdk, traits::GtkWindowExt};