Skip to content

Commit

Permalink
client: create other event queues
Browse files Browse the repository at this point in the history
  • Loading branch information
elinorbgr committed Mar 13, 2018
1 parent 738dc80 commit ed3ed4b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions wayland-client/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub(crate) struct DisplayInner {
}

impl DisplayInner {
#[cfg(feature = "native_lib")]
pub(crate) fn ptr(&self) -> *mut wl_display {
self.proxy.c_ptr() as *mut _
}
Expand Down Expand Up @@ -115,6 +116,23 @@ impl Display {
}
}
}

pub fn create_event_queue(&self) -> EventQueue {
#[cfg(not(feature = "native_lib"))]
{
unimplemented!()
}
#[cfg(feature = "native_lib")]
unsafe {
let ptr = ffi_dispatch!(
WAYLAND_CLIENT_HANDLE,
wl_display_create_queue,
self.inner.ptr()
);

EventQueue::new(self.inner.clone(), Some(ptr))
}
}
}

impl Deref for Display {
Expand Down

0 comments on commit ed3ed4b

Please sign in to comment.