Add methods allowing creation of X11 window with specified visual and screen
This commit is contained in:
parent
bc0dd0f854
commit
d4b8fd9f5a
3 changed files with 50 additions and 11 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue