diff options
author | Canop <cano.petrole@gmail.com> | 2020-06-29 16:03:41 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2020-06-29 16:03:41 +0200 |
commit | 83dcfd8166e6f07e7c6bb811bfe5dc2f58aede04 (patch) | |
tree | e55bc8bd2831431d322cfb81f99dc9396888f64b /src/app/app.rs | |
parent | 93a5dcf11c9d1a35b429ac2bf3e164848c0f2ad5 (diff) |
version 0.18.2 - remove all flickering causesv0.18.2
Diffstat (limited to 'src/app/app.rs')
-rw-r--r-- | src/app/app.rs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/app/app.rs b/src/app/app.rs index b2b9d0c..ce89f77 100644 --- a/src/app/app.rs +++ b/src/app/app.rs @@ -276,16 +276,16 @@ impl App { screen: &mut Screen, con: &AppContext, dam: &mut Dam, - ) -> Result<(), ProgramError> { + ) -> Result<bool, ProgramError> { // we start with the focused panel - self.mut_panel().do_pending_tasks(screen, con, dam)?; + let mut did_something = self.mut_panel().do_pending_tasks(screen, con, dam)?; // then the other ones for idx in 0..self.panels.len().get() { if idx != self.active_panel_idx { - self.panels[idx].do_pending_tasks(screen, con, dam)?; + did_something |= self.panels[idx].do_pending_tasks(screen, con, dam)?; } } - Ok(()) + Ok(did_something) } /// This is the main loop of the application @@ -321,14 +321,14 @@ impl App { } } - self.display_panels(w, screen, &skin, con)?; - w.flush()?; - loop { if !self.quitting { - self.do_pending_tasks(screen, con, &mut dam)?; self.display_panels(w, screen, &skin, con)?; w.flush()?; + if self.do_pending_tasks(screen, con, &mut dam)? { + self.display_panels(w, screen, &skin, con)?; + w.flush()?; + } } let event = match dam.next_event() { Some(event) => event, @@ -362,8 +362,6 @@ impl App { self.apply_command(w, cmd, screen, &skin.focused, con)?; } } - self.display_panels(w, screen, &skin, con)?; - w.flush()?; event_source.unblock(self.quitting); } |