diff --git a/src/native/x11/X11MiniFB.c b/src/native/x11/X11MiniFB.c index 467ed5b..538c65c 100644 --- a/src/native/x11/X11MiniFB.c +++ b/src/native/x11/X11MiniFB.c @@ -495,3 +495,10 @@ unsigned int mfb_get_screen_size() { return (s_screen_width << 16) | s_screen_height; } +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void* mfb_get_window_handle(void* window) { + WindowInfo* win = (WindowInfo*)window; + return (void*)(uintptr_t)win->window; +} + diff --git a/src/os/unix/mod.rs b/src/os/unix/mod.rs index 6b6bdcc..6bf24cc 100644 --- a/src/os/unix/mod.rs +++ b/src/os/unix/mod.rs @@ -32,6 +32,7 @@ extern { fn mfb_set_shared_data(window: *mut c_void, target: *mut SharedData); fn mfb_should_close(window: *mut c_void) -> i32; fn mfb_get_screen_size() -> u32; + fn mfb_get_window_handle(window: *mut c_void) -> *mut c_void; } #[derive(Default)] @@ -224,7 +225,7 @@ impl Window { #[inline] pub fn get_window_handle(&self) -> *mut raw::c_void { - self.window_handle as *mut raw::c_void + unsafe { mfb_get_window_handle(self.window_handle) as *mut raw::c_void } } #[inline]