1
0
Fork 0

X11: set XlibWindowHandle.window and XlibDisplayhandle.display

This commit is contained in:
Joakim Frostegård 2022-11-23 23:34:42 +01:00 committed by Robbert van der Helm
parent eb94b4d7ab
commit 6f32584149

View file

@ -690,8 +690,9 @@ impl Window {
unsafe impl HasRawWindowHandle for Window { unsafe impl HasRawWindowHandle for Window {
fn raw_window_handle(&self) -> RawWindowHandle { fn raw_window_handle(&self) -> RawWindowHandle {
let mut handle = XlibWindowHandle::empty(); let mut handle = XlibWindowHandle::empty();
handle.window = self.window_id as c_ulong; handle.window = self.window_id as c_ulong;
handle.display = self.xcb_connection.conn.get_raw_dpy() as *mut c_void; // FIXME: handle.visual_id?
RawWindowHandle::Xlib(handle) RawWindowHandle::Xlib(handle)
} }
@ -699,7 +700,12 @@ unsafe impl HasRawWindowHandle for Window {
unsafe impl HasRawDisplayHandle for Window { unsafe impl HasRawDisplayHandle for Window {
fn raw_display_handle(&self) -> RawDisplayHandle { fn raw_display_handle(&self) -> RawDisplayHandle {
RawDisplayHandle::Xlib(XlibDisplayHandle::empty()) let mut handle = XlibDisplayHandle::empty();
handle.display = self.xcb_connection.conn.get_raw_dpy() as *mut c_void;
// FIXME: handle.screen?
RawDisplayHandle::Xlib(handle)
} }
} }