From 07a6efcb22c002ad09432e8dbe87eed888821c2c Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Sun, 21 Feb 2021 19:06:02 +0100 Subject: Make the first tree item stable on expand / collapse again Regression introduced with 06b1674 --- ProcessList.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ProcessList.c') diff --git a/ProcessList.c b/ProcessList.c index dcfa05dc..50a9b35d 100644 --- a/ProcessList.c +++ b/ProcessList.c @@ -535,7 +535,7 @@ void ProcessList_rebuildPanel(ProcessList* this) { if (this->following == -1) { /* If the last item was selected, keep the new last item selected */ - if (currPos == currSize - 1) + if (currPos > 0 && currPos == currSize - 1) Panel_setSelected(this->panel, Panel_size(this->panel) - 1); else Panel_setSelected(this->panel, currPos); -- cgit v1.2.3