Events loop backend (#269)

* Don't use UNIX_BACKEND in Window2::new

* Move get_available_monitors and get_primary_monitor to EventsLoop

* Remove UNIX_BACKEND

* Restore choosing the Linux backend

* Return a XNotSupported for new_x11()

* Fix fullscreen example
This commit is contained in:
tomaka 2017-09-01 11:04:57 +02:00 committed by GitHub
parent e65cacbc86
commit 3d1c18ded9
13 changed files with 227 additions and 214 deletions

View file

@ -120,6 +120,12 @@ impl EventsLoop {
result
}
/// Returns the `XConnection` of this events loop.
#[inline]
pub fn x_connection(&self) -> &Arc<XConnection> {
&self.display
}
pub fn create_proxy(&self) -> EventsLoopProxy {
EventsLoopProxy {
pending_wakeup: Arc::downgrade(&self.pending_wakeup),
@ -675,12 +681,11 @@ lazy_static! { // TODO: use a static mutex when that's possible, and put me
}
impl Window2 {
pub fn new(events_loop: &::platform::EventsLoop,
pub fn new(x_events_loop: &EventsLoop,
window: &::WindowAttributes,
pl_attribs: &PlatformSpecificWindowBuilderAttributes)
-> Result<Self, CreationError>
{
let x_events_loop = if let ::platform::EventsLoop::X(ref e) = *events_loop { e } else { unreachable!() };
let win = ::std::sync::Arc::new(try!(Window::new(&x_events_loop, window, pl_attribs)));
// creating IM