Je crée un programme qui utilise glutin et je veux fournir un drapeau de ligne de commande pour rendre la fenêtre redirect-redirect afin qu'il puisse être utilisé comme fond d'écran pour certains gestionnaires de fenêtres qui ne supportent pas la fenêtre du bureau type.Comment puis-je faire une fenêtre override-redirect with glutin?
J'ai fait beaucoup de recherche et réussi à concocter un bloc de code que je pensais fonctionner, en utilisant l'affichage xlib fourni et la fenêtre de glutin. Voici mon code existant:
unsafe {
use glutin::os::unix::WindowExt;
let x_connection = std::sync::Arc::<glutin::os::unix::x11::XConnection>::into_raw(display.gl_window().get_xlib_xconnection().unwrap());
((*x_connection).xlib.XChangeWindowAttributes)(
display.gl_window().get_xlib_display().unwrap() as *mut glutin::os::unix::x11::ffi::Display,
display.gl_window().get_xlib_window().unwrap() as glutin::os::unix::x11::ffi::XID,
glutin::os::unix::x11::ffi::CWOverrideRedirect,
&mut glutin::os::unix::x11::ffi::XSetWindowAttributes {
background_pixmap: 0,
background_pixel: 0,
border_pixmap: 0,
border_pixel: 0,
bit_gravity: 0,
win_gravity: 0,
backing_store: 0,
backing_planes: 0,
backing_pixel: 0,
save_under: 0,
event_mask: 0,
do_not_propagate_mask: 0,
override_redirect: 1,
colormap: 0,
cursor: 0,
}
);
}
Il ne me donne pas d'erreurs, et compile et fonctionne très bien avec le reste du code, mais il ne redirige override-fait pas la fenêtre comme je veux.