mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 05:10:03 -04:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user