Add get_x11_xconnection function
This commit is contained in:
parent
d4b8fd9f5a
commit
f5812018ca
3 changed files with 20 additions and 9 deletions
|
|
@ -21,14 +21,14 @@ pub struct PlatformSpecificWindowBuilderAttributes {
|
|||
pub screen_id: Option<i32>,
|
||||
}
|
||||
|
||||
enum Backend {
|
||||
pub enum Backend {
|
||||
X(Arc<XConnection>),
|
||||
Wayland(Arc<wayland::WaylandContext>),
|
||||
Error(XNotSupported),
|
||||
}
|
||||
}
|
||||
|
||||
lazy_static!(
|
||||
static ref BACKEND: Backend = {
|
||||
pub static ref BACKEND: Backend = {
|
||||
if let Some(ctxt) = wayland::WaylandContext::init() {
|
||||
Backend::Wayland(Arc::new(ctxt))
|
||||
} else {
|
||||
|
|
@ -40,6 +40,7 @@ lazy_static!(
|
|||
};
|
||||
);
|
||||
|
||||
|
||||
pub enum Window {
|
||||
#[doc(hidden)]
|
||||
X(x11::Window),
|
||||
|
|
|
|||
|
|
@ -3,5 +3,7 @@
|
|||
pub use self::api_dispatch::{Window, WindowProxy, MonitorId, get_available_monitors, get_primary_monitor};
|
||||
pub use self::api_dispatch::{WaitEventsIterator, PollEventsIterator};
|
||||
pub use self::api_dispatch::PlatformSpecificWindowBuilderAttributes;
|
||||
pub use self::api_dispatch::Backend as UnixBackend;
|
||||
pub use self::api_dispatch::BACKEND as UNIX_BACKEND;
|
||||
|
||||
mod api_dispatch;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue