From 43dbedbe0ac9cd1ccba44e9e57464642537367bb Mon Sep 17 00:00:00 2001
From: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
Date: Mon, 13 Mar 2023 16:55:32 -0400
Subject: [PATCH] chat-view: add a larger offscreen buffer for the message list
 view

Message delegates can have different heights and scrolling through the list view may cause vertical flickering without a substantial pre-fetching of items.

GitLab: #1020
Change-Id: Ic776b67d62773294f4548be3475804cd1824ef2b
---
 src/app/mainview/components/MessageListView.qml | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/app/mainview/components/MessageListView.qml b/src/app/mainview/components/MessageListView.qml
index aa1d0fa38..98a691979 100644
--- a/src/app/mainview/components/MessageListView.qml
+++ b/src/app/mainview/components/MessageListView.qml
@@ -1,7 +1,5 @@
 /*
  * Copyright (C) 2021-2023 Savoir-faire Linux Inc.
- * Author: Trevor Tabah <trevor.tabah@savoirfairelinux.com>
- * Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -169,6 +167,11 @@ JamiListView {
     topMargin: 12
     spacing: 2
 
+    // The offscreen buffer is set to a reasonable value to avoid flickering
+    // when scrolling up and down in a list with items of different heights.
+    displayMarginBeginning: 2048
+    displayMarginEnd: 2048
+
     maximumFlickVelocity: 2048
     verticalLayoutDirection: ListView.BottomToTop
     boundsBehavior: Flickable.StopAtBounds
-- 
GitLab