Rewrite of wayland backend to new wayland-client API (#325)

* wayland: clean state for rewrite to new wayland-client API

* wayland: context init

* wayland: Monitors logic

* wayland: Basic event loop logic

* wayland: Keyboard handling

* wayland: pointer handling

* wayland: refactor to remove WaylandContext

* wayland: window logic

* wayland: event dispatching logic

* wayland: update changelog
This commit is contained in:
Victor Berger 2017-10-20 09:46:42 +02:00 committed by tomaka
parent 4e4db1749d
commit d10312c6b1
8 changed files with 953 additions and 1158 deletions

View file

@ -332,8 +332,8 @@ impl EventsLoop {
}
pub fn new_wayland() -> Result<EventsLoop, ()> {
wayland::WaylandContext::init()
.map(|ctx| EventsLoop::Wayland(wayland::EventsLoop::new(ctx)))
wayland::EventsLoop::new()
.map(EventsLoop::Wayland)
.ok_or(())
}
@ -347,7 +347,7 @@ impl EventsLoop {
#[inline]
pub fn get_available_monitors(&self) -> VecDeque<MonitorId> {
match *self {
EventsLoop::Wayland(ref evlp) => wayland::get_available_monitors(evlp.context())
EventsLoop::Wayland(ref evlp) => evlp.get_available_monitors()
.into_iter()
.map(MonitorId::Wayland)
.collect(),
@ -361,7 +361,7 @@ impl EventsLoop {
#[inline]
pub fn get_primary_monitor(&self) -> MonitorId {
match *self {
EventsLoop::Wayland(ref evlp) => MonitorId::Wayland(wayland::get_primary_monitor(evlp.context())),
EventsLoop::Wayland(ref evlp) => MonitorId::Wayland(evlp.get_primary_monitor()),
EventsLoop::X(ref evlp) => MonitorId::X(x11::get_primary_monitor(evlp.x_connection())),
}
}