Implement changes to RedrawRequested event (#1062)

* Implement changes to `RedrawRequested` event

Implements the changes described in #1041 for the X11 platform and for
platform-independent public-facing code.

* Fix `request_redraw` example

* Fix examples in lib docs

* Only issue `RedrawRequested` on final `Expose` event
This commit is contained in:
Murarth 2019-07-30 23:31:12 -07:00 committed by Osspial
parent c10c820311
commit 0c151f9fb3
7 changed files with 67 additions and 37 deletions

View file

@ -20,14 +20,11 @@ fn main() {
event: WindowEvent::CloseRequested,
..
} => *control_flow = ControlFlow::Exit,
Event::EventsCleared => {
Event::MainEventsCleared => {
window.request_redraw();
*control_flow = ControlFlow::WaitUntil(Instant::now() + Duration::new(1, 0))
}
Event::WindowEvent {
event: WindowEvent::RedrawRequested,
..
} => {
Event::RedrawRequested(_) => {
println!("{:?}", event);
}
_ => (),