mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-29 21:00:04 -04:00
Introduce a WindowProxy for accessing a subset of functionality
from other threads. This currently provides a way for other threads to wakeup a blocked event loop on X11. Other platforms have stub functions that need to be implemented. This is similar to the functionality of glfwPostEmptyEvent.
This commit is contained in:
@@ -207,6 +207,10 @@ impl Window {
|
||||
pub fn set_inner_size(&self, _x: uint, _y: uint) {
|
||||
}
|
||||
|
||||
pub fn create_window_proxy(&self) -> WindowProxy {
|
||||
WindowProxy
|
||||
}
|
||||
|
||||
pub fn poll_events(&self) -> Vec<Event> {
|
||||
use std::time::Duration;
|
||||
use std::io::timer;
|
||||
@@ -271,6 +275,16 @@ impl Window {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "window")]
|
||||
#[deriving(Clone)]
|
||||
pub struct WindowProxy;
|
||||
|
||||
impl WindowProxy {
|
||||
pub fn wakeup_event_loop(&self) {
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for Window {
|
||||
fn drop(&mut self) {
|
||||
|
||||
Reference in New Issue
Block a user