AltF02 / x11-rs

Rust bindings for X11 libraries
https://docs.rs/x11
MIT License
207 stars 66 forks source link

Add Xcomposite bindings #121

Open malwrar opened 4 years ago

malwrar commented 4 years ago

Didn't test this too much, but it looks like the x11 crate bindings work on my end. Some test code:

use std::ptr::{null};
use std::os::raw::c_int;
use x11::xlib::*;
use x11::xcomposite::*;

fn main() {
    unsafe {
        let mut event_base_return: c_int = 0;
        let mut error_base_return: c_int = 0;

        let display = XOpenDisplay(null());
        if display.is_null() {
            panic!("Failed to open default X display.");
        }

        XCompositeQueryExtension(display, &mut event_base_return, &mut error_base_return);
        let xcomposite_version = XCompositeVersion();

        println!("{} {}", event_base_return, error_base_return);
        println!("{}", xcomposite_version);
    }
}
LoganDark commented 2 years ago

I'm going to test this (see #154)