cplay-ng

simple curses audio player
git clone https://git.ce9e.org/cplay-ng.git

commit
e7a26a30ab39cfb4a32f5b09f42f1b916550b4c8
parent
919251e3a3fe3f8834e985957da04dcd227457d7
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2020-09-05 16:55
force redraw on resize

Diffstat

M cplay.py 9 +++++++--

1 files changed, 7 insertions, 2 deletions


diff --git a/cplay.py b/cplay.py

@@ -640,10 +640,14 @@ class Application:
  640   640         )
  641   641         yield space_between(status, counter, self.cols)
  642   642 
  643    -1     def render(self):
   -1   643     def render(self, force=False):
  644   644         lines = list(self._render())
  645   645         for i, line in enumerate(lines):
  646    -1             if len(self.old_lines) > i and line == self.old_lines[i]:
   -1   646             if (
   -1   647                 not force
   -1   648                 and len(self.old_lines) > i
   -1   649                 and line == self.old_lines[i]
   -1   650             ):
  647   651                 continue
  648   652             screen.move(i, 0)
  649   653             screen.clrtoeol()
@@ -695,6 +699,7 @@ class Application:
  695   699                     if key.fileobj is self.resize_in:
  696   700                         os.read(self.resize_in, 8)
  697   701                         self.on_resize()
   -1   702                         self.render(force=True)
  698   703                     elif key.fileobj is sys.stdin:
  699   704                         self.process_key(screen.get_wch())
  700   705                     elif key.fileobj is player.stderr_r: