mirror of
https://github.com/storytold/winit.git
synced 2026-11-29 17:55:16 +01:00
Add get_x11_xconnection function
This commit is contained in:
1 parent
d4b8fd9f5a
commit
f5812018ca
3 files changed
+20
-9
No files matched your search
@@ -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;
|
||||
Reference in new issue
Block a user