From a9b3312d1a4962d07a2e7976e8352c7113201a9e Mon Sep 17 00:00:00 2001 From: Yexo Date: Mon, 1 Jun 2020 10:19:47 +0200 Subject: Fix #8024: make online content gui more responsive while loading Previously the internal content list was invalidated and sorted for every new item added. Now the sorting is delayed until the GUI is drawn, which means we only sort once per GUI tick. Since the amount of incoming items per GUI tick is not controlled by the GUI but rather by network speed, we were previously doing a lot of duplicate work per tick, causing the mouse cursor to lag while the list was initialized. --- src/network/network_content_gui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 6083396ee..dd87a4948 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -951,7 +951,7 @@ public: { if (this->auto_select && !rci->IsSelected()) _network_content_client.ToggleSelectedState(rci); this->content.ForceRebuild(); - this->InvalidateData(); + this->InvalidateData(0, false); } void OnDownloadComplete(ContentID cid) override -- cgit v1.2.3-70-g09d2