From 252e0e29f45c46f25b1b31229f567a552376ecec Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 14 Jul 2017 08:32:49 +0200 Subject: [PATCH] primitivus (chat): only scroll down if we are at the bottom of the discussion --- frontends/src/primitivus/chat.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontends/src/primitivus/chat.py b/frontends/src/primitivus/chat.py index 9c7705d3..2da2b8cd 100644 --- a/frontends/src/primitivus/chat.py +++ b/frontends/src/primitivus/chat.py @@ -449,7 +449,10 @@ class Chat(PrimitivusWidget, quick_chat.QuickChat): else: wid = MessageWidget(message) self.mess_walker.append(wid) - self.mess_widgets.focus_position = len(self.mess_walker) - 1 # scroll down + current_focus = self.mess_widgets.focus_position + bottom = len(self.mess_walker) - 1 + if current_focus == bottom - 1: + self.mess_widgets.focus_position = bottom # scroll down self.host.redraw() # FIXME: should not be necessary if self._user_moved(message): return # no notification for moved messages