From 0663269482968624829ea58d4833a31a670728ee Mon Sep 17 00:00:00 2001 From: Victor Berger Date: Sun, 16 Oct 2016 22:53:53 +0200 Subject: [PATCH] wayland: Implement wakeup_event_loop() --- src/api/wayland/window.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/api/wayland/window.rs b/src/api/wayland/window.rs index b286b404..aa71bc3b 100644 --- a/src/api/wayland/window.rs +++ b/src/api/wayland/window.rs @@ -12,12 +12,17 @@ use super::wayland_window; use super::wayland_window::DecoratedSurface; #[derive(Clone)] -pub struct WindowProxy; +pub struct WindowProxy { + ctxt: Arc, + eviter: Arc>>, +} impl WindowProxy { #[inline] pub fn wakeup_event_loop(&self) { - unimplemented!() + // Send a sync event, so that any waiting "dispatch" will return + self.ctxt.display.sync(); + self.eviter.lock().unwrap().push_back(Event::Awakened); } } @@ -209,7 +214,10 @@ impl Window { #[inline] pub fn create_window_proxy(&self) -> WindowProxy { - WindowProxy + WindowProxy { + ctxt: self.ctxt.clone(), + eviter: self.eviter.clone() + } } #[inline]