INNER CODE UNIT · Rust

is_gamescope_display

ShadowBlip/OpenGamepadUI · extensions/core/src/gamescope.rs:207

fn is_gamescope_display(display: &str) -> bool {
    let mut xwayland = XWayland::new(display.to_string());
    if let Err(e) = xwayland.connect() {
        log::debug!("Failed to connect to display {display}: {e:?}");
        return false;
    }

    let root_window_id = match xwayland.get_root_window_id() {
        Ok(root_window_id) => root_window_id,
        Err(e) => {
            log::debug!("Failed to get root window for display {display}: {e:?}");
            return false;
        }
    };

    match xwayland.has_xprop(root_window_id, GamescopeAtom::XwaylandServerId) {
        Ok(is_gamescope) => is_gamescope,
        Err(e) => {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…