From bfc26a0180c4bdc262e13dd603bfbb28d516b471 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 3 Oct 2020 15:55:50 +0100 Subject: [PATCH] Fix unnecessary status bar redraws when there is no news to show --- src/news_gui.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 58194db53c..f50d1d6209 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -676,8 +676,6 @@ static void MoveToNextTickerItem() * there is no status bar but possible news. */ if (FindWindowById(WC_STATUS_BAR, 0) == nullptr) return; - InvalidateWindowData(WC_STATUS_BAR, 0, SBI_NEWS_DELETED); // invalidate the statusbar - /* if we're not at the last item, then move on */ while (_statusbar_news_item != _latest_news) { _statusbar_news_item = (_statusbar_news_item == nullptr) ? _oldest_news : _statusbar_news_item->next; @@ -776,6 +774,7 @@ static void DeleteNewsItem(NewsItem *ni) _statusbar_news_item = ni->prev; /* About to remove the currently displayed item (ticker, or just a reminder) */ + InvalidateWindowData(WC_STATUS_BAR, 0, SBI_NEWS_DELETED); // invalidate the statusbar MoveToNextTickerItem(); }