mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
Add methods allowing creation of X11 window with specified visual and screen
This commit is contained in:
@@ -13,9 +13,13 @@ use api::x11;
|
||||
use api::x11::XConnection;
|
||||
use api::x11::XError;
|
||||
use api::x11::XNotSupported;
|
||||
use api::x11::ffi::XVisualInfo;
|
||||
|
||||
#[derive(Clone, Default)]
|
||||
pub struct PlatformSpecificWindowBuilderAttributes;
|
||||
pub struct PlatformSpecificWindowBuilderAttributes {
|
||||
pub visual_infos: Option<XVisualInfo>,
|
||||
pub screen_id: Option<i32>,
|
||||
}
|
||||
|
||||
enum Backend {
|
||||
X(Arc<XConnection>),
|
||||
@@ -165,7 +169,7 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
|
||||
|
||||
impl Window {
|
||||
#[inline]
|
||||
pub fn new(window: &WindowAttributes, _: &PlatformSpecificWindowBuilderAttributes)
|
||||
pub fn new(window: &WindowAttributes, pl_attribs: &PlatformSpecificWindowBuilderAttributes)
|
||||
-> Result<Window, CreationError>
|
||||
{
|
||||
match *BACKEND {
|
||||
@@ -174,7 +178,7 @@ impl Window {
|
||||
},
|
||||
|
||||
Backend::X(ref connec) => {
|
||||
x11::Window::new(connec, window).map(Window::X)
|
||||
x11::Window::new(connec, window, pl_attribs).map(Window::X)
|
||||
},
|
||||
|
||||
Backend::Error(ref error) => {
|
||||
|
||||
Reference in New Issue
Block a user