diff --git a/src/lib.rs b/src/lib.rs index cefb363..c352dea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -289,10 +289,9 @@ impl Cursive { while self.running { // Do we need to redraw everytime? // Probably, actually. - // TODO: Do we actually need to clear everytime? - B::clear(); // TODO: Do we need to re-layout everytime? self.layout(); + // TODO: Do we need to redraw every view every time? // (Is this getting repetitive? :p) self.draw(); @@ -300,6 +299,10 @@ impl Cursive { // Wait for next event. // (If set_fps was called, this returns -1 now and then) let event = B::poll_event(); + if event == Event::Key(event::Key::Resize) { + B::clear(); + continue; + } // Event dispatch order: // * Focused element: diff --git a/src/view/stack_view.rs b/src/view/stack_view.rs index 5619ed0..4dd1281 100644 --- a/src/view/stack_view.rs +++ b/src/view/stack_view.rs @@ -1,5 +1,6 @@ use std::any::Any; +use backend::Backend; use vec::Vec2; use view::{Offset, Position, Selector, ShadowView, View}; use event::{Event, EventResult}; @@ -54,6 +55,7 @@ impl StackView { /// Remove the top-most layer. pub fn pop_layer(&mut self) { self.layers.pop(); + ::B::clear(); } }