Skip to content

Commit

Permalink
X11: provide XlibWindowHandle.visual_id
Browse files Browse the repository at this point in the history
  • Loading branch information
greatest-ape authored and robbert-vdh committed Sep 30, 2023
1 parent 4130502 commit 0df4348
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/x11/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ pub struct Window {
xcb_connection: XcbConnection,
window_id: u32,
window_info: WindowInfo,
visual_id: u32,
// FIXME: There's all this mouse cursor logic but it's never actually used, is this correct?
mouse_cursor: MouseCursor,

Expand Down Expand Up @@ -336,6 +337,7 @@ impl Window {
xcb_connection,
window_id,
window_info,
visual_id: visual,
mouse_cursor: MouseCursor::default(),

frame_interval: Duration::from_millis(15),
Expand Down Expand Up @@ -685,7 +687,9 @@ impl Window {
unsafe impl HasRawWindowHandle for Window {
fn raw_window_handle(&self) -> RawWindowHandle {
let mut handle = XlibWindowHandle::empty();
handle.window = self.window_id as c_ulong;

handle.window = self.window_id.into();
handle.visual_id = self.visual_id.into();

RawWindowHandle::Xlib(handle)
}
Expand Down

0 comments on commit 0df4348

Please sign in to comment.