Merge pull request #154 from vberger/wayland_new_api
Port wayland to the new API
This commit is contained in:
commit
2e82cac69a
9 changed files with 696 additions and 723 deletions
|
|
@ -44,7 +44,7 @@ impl EventsLoop {
|
|||
pub fn poll_events<F>(&self, mut callback: F)
|
||||
where F: FnMut(::Event)
|
||||
{
|
||||
let mut windows = self.windows.lock().unwrap();
|
||||
let windows = self.windows.lock().unwrap();
|
||||
for window in windows.iter() {
|
||||
for event in window.poll_events() {
|
||||
callback(::Event::WindowEvent {
|
||||
|
|
@ -63,7 +63,7 @@ impl EventsLoop {
|
|||
// Yeah that's a very bad implementation.
|
||||
loop {
|
||||
self.poll_events(|e| callback(e));
|
||||
::std::thread::sleep_ms(5);
|
||||
::std::thread::sleep(::std::time::Duration::from_millis(5));
|
||||
if self.interrupted.load(::std::sync::atomic::Ordering::Relaxed) {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -836,7 +836,7 @@ impl Window {
|
|||
// differs on the desktop environments or themes.
|
||||
//
|
||||
// Try the better looking (or more suiting) names first.
|
||||
let mut xcursor = match cursor {
|
||||
let xcursor = match cursor {
|
||||
MouseCursor::Alias => load("link"),
|
||||
MouseCursor::Arrow => load("arrow"),
|
||||
MouseCursor::Cell => load("plus"),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
use std::ptr;
|
||||
use std::fmt;
|
||||
use std::error::Error;
|
||||
use std::ffi::CString;
|
||||
use std::sync::Mutex;
|
||||
|
||||
use libc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue