Wayland's eventloop 2.0 (#790)

* match unix common API to evl 2.0

* wayland: eventloop2.0

* make EventLoopProxy require T: 'static

* Fix linux build and tests

* wayland: update sctk & small fixes
This commit is contained in:
Victor Berger
2019-02-21 10:51:43 +01:00
committed by GitHub
parent 9602716ed2
commit 6513351e0c
13 changed files with 532 additions and 592 deletions

View File

@@ -601,13 +601,13 @@ impl EventLoopThreadExecutor {
type ThreadExecFn = Box<Box<FnMut()>>;
#[derive(Clone)]
pub struct EventLoopProxy<T> {
pub struct EventLoopProxy<T: 'static> {
target_window: HWND,
event_send: Sender<T>,
}
unsafe impl<T: Send> Send for EventLoopProxy<T> {}
unsafe impl<T: Send + 'static> Send for EventLoopProxy<T> {}
impl<T> EventLoopProxy<T> {
impl<T: 'static> EventLoopProxy<T> {
pub fn send_event(&self, event: T) -> Result<(), EventLoopClosed> {
unsafe {
if winuser::PostMessageW(self.target_window, *USER_EVENT_MSG_ID, 0, 0) != 0 {