From 0b624e161ea611d526751f7df513a48ee59a5f60 Mon Sep 17 00:00:00 2001 From: Victor Berger Date: Tue, 13 Mar 2018 18:09:23 +0100 Subject: [PATCH] client: create other event queues --- wayland-client/src/display.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/wayland-client/src/display.rs b/wayland-client/src/display.rs index 59c0b4d22e0..5dd565689e6 100644 --- a/wayland-client/src/display.rs +++ b/wayland-client/src/display.rs @@ -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 _ } @@ -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 {