mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-12 05:31:31 +11:00
Fixes for x11-rs/osmesa-sys conversion.
This commit is contained in:
parent
2d20050b89
commit
c9194e922e
|
@ -46,10 +46,10 @@ extern crate cocoa;
|
||||||
extern crate core_foundation;
|
extern crate core_foundation;
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
extern crate glutin_core_graphics as core_graphics;
|
extern crate glutin_core_graphics as core_graphics;
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
|
||||||
extern crate osmesa_sys;
|
|
||||||
#[cfg(target_os = "linux")]
|
|
||||||
extern crate x11;
|
extern crate x11;
|
||||||
|
#[cfg(all(any(target_os = "linux", target_os = "freebsd"), feature="headless"))]
|
||||||
|
extern crate osmesa_sys;
|
||||||
|
|
||||||
pub use events::*;
|
pub use events::*;
|
||||||
#[cfg(feature = "headless")]
|
#[cfg(feature = "headless")]
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#[cfg(feature="headless")]
|
||||||
pub use osmesa_sys::*;
|
pub use osmesa_sys::*;
|
||||||
pub use x11::keysym::*;
|
pub use x11::keysym::*;
|
||||||
pub use x11::xcursor::*;
|
pub use x11::xcursor::*;
|
||||||
|
|
|
@ -90,7 +90,7 @@ pub struct WindowProxy {
|
||||||
impl WindowProxy {
|
impl WindowProxy {
|
||||||
pub fn wakeup_event_loop(&self) {
|
pub fn wakeup_event_loop(&self) {
|
||||||
let mut xev = ffi::XClientMessageEvent {
|
let mut xev = ffi::XClientMessageEvent {
|
||||||
_type: ffi::ClientMessage,
|
type_: ffi::ClientMessage,
|
||||||
window: self.x.window,
|
window: self.x.window,
|
||||||
format: 32,
|
format: 32,
|
||||||
message_type: 0,
|
message_type: 0,
|
||||||
|
@ -171,7 +171,7 @@ impl<'a> Iterator for PollEventsIterator<'a> {
|
||||||
use events::ElementState::{Pressed, Released};
|
use events::ElementState::{Pressed, Released};
|
||||||
let event: &mut ffi::XKeyEvent = unsafe { mem::transmute(&xev) };
|
let event: &mut ffi::XKeyEvent = unsafe { mem::transmute(&xev) };
|
||||||
|
|
||||||
if event._type == ffi::KeyPress {
|
if event.type_ == ffi::KeyPress {
|
||||||
let raw_ev: *mut ffi::XKeyEvent = event;
|
let raw_ev: *mut ffi::XKeyEvent = event;
|
||||||
unsafe { ffi::XFilterEvent(mem::transmute(raw_ev), self.window.x.window) };
|
unsafe { ffi::XFilterEvent(mem::transmute(raw_ev), self.window.x.window) };
|
||||||
}
|
}
|
||||||
|
@ -335,7 +335,7 @@ impl Window {
|
||||||
return Err(OsError(format!("glx::ChooseFBConfig failed")));
|
return Err(OsError(format!("glx::ChooseFBConfig failed")));
|
||||||
}
|
}
|
||||||
let preferred_fb = *fb; // TODO: choose more wisely
|
let preferred_fb = *fb; // TODO: choose more wisely
|
||||||
ffi::XFree(fb as *mut ());
|
ffi::XFree(fb as *mut _);
|
||||||
preferred_fb
|
preferred_fb
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue