chiark / gitweb /
Fix missing screen refresh when new posts arrive.
authorSimon Tatham <anakin@pobox.com>
Sun, 10 Dec 2023 15:32:16 +0000 (15:32 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 10 Dec 2023 15:32:16 +0000 (15:32 +0000)
The rework of resize handling had the accidental side effect that when
the self-pipe from the stream-watching thread signals us, we do call
extend_future() on our feeds, but we _don't_ loop back round to the
screen redraw, so that if the user is sitting in their home timeline,
the bottom line of the screen doesn't update to show that new stuff is
available.

cursesclient.py

index 3e8c0c09dacf0a8fd6b72de91f9f4bad3aaa8010..cde2d8920d890a9995a8dd6aac4cacbdad0bfccb 100644 (file)
@@ -129,12 +129,12 @@ class CursesUI(client.Client):
             rfds_in.append(sp.rfd)
         rfds_out, _, _ = select.select(rfds_in, [], [])
         rfds_out = set(rfds_out)
-        resized = False
+        activity = False
         for (sp, handler, _) in self.selfpipes:
             if sp.rfd in rfds_out and sp.check():
                 if handler():
-                    resized = True
-        if resized:
+                    activity = True
+        if activity:
             return None
         if 0 in rfds_out:
             return self.get_wch()
@@ -236,20 +236,18 @@ class CursesUI(client.Client):
                 self.clear()
                 self.activity_stack[-1].render()
                 self.scr.refresh()
-                while True:
-                    ch = self.get_input()
-                    if ch is not None:
-                        break
-                    if self.resized:
-                        self.resized = False
-                        ch = curses.KEY_RESIZE
-                        break
+
+                ch = self.get_input()
+                if ch is None and self.resized:
+                    self.resized = False
+                    ch = curses.KEY_RESIZE
+
                 if ch == ctrl('['):
                     if self.activity_stack[-1] is not self.escape_menu:
                         self.activity_stack.append(self.escape_menu)
                 elif ch == curses.KEY_RESIZE:
                     self.scr_h, self.scr_w = self.scr.getmaxyx()
-                else:
+                elif ch is not None:
                     result = self.activity_stack[-1].handle_key(ch)
                     if result == 'quit':
                         if len(self.activity_stack) > 1: