Skip to content

Commit

Permalink
Add a test case
Browse files Browse the repository at this point in the history
Signed-off-by: John Nunley <[email protected]>
  • Loading branch information
notgull committed Nov 2, 2023
1 parent a9f5958 commit db0e10a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/libxcb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mod example {
DisplayHandle, RawDisplayHandle, RawWindowHandle, WindowHandle, XcbDisplayHandle,
XcbWindowHandle,
};
use std::{num::NonZeroU32, ptr::NonNull};
use std::{env, num::NonZeroU32, ptr::NonNull};
use x11rb::{
connection::Connection,
protocol::{
Expand All @@ -24,7 +24,11 @@ mod example {

// x11rb doesn't use raw-window-handle yet, so just create our own.
let display_handle = XcbDisplayHandle::new(
NonNull::new(conn.get_raw_xcb_connection() as *mut _),
if env::var_os("SOFTBUFFER_NO_DISPLAY").is_some() {
None
} else {
NonNull::new(conn.get_raw_xcb_connection() as *mut _)
},
screen as _,
);

Expand Down

0 comments on commit db0e10a

Please sign in to comment.