diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-03-03 19:56:39 +0100 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2021-03-03 20:06:14 +0100 |
commit | 59a150e8d7f1e50d101d191448432a4424101c57 (patch) | |
tree | f0679c7ef0b658769b66ed80ca560e2401bc0855 /ProcessList.c | |
parent | 2328e52403dfa52d122a9f7ccbd365beaedb8c9f (diff) |
Follow followed process when switching thread visibilities
Do not stop following a process when switching the visibility of
userland or kernel threads.
Related: #557
Diffstat (limited to 'ProcessList.c')
-rw-r--r-- | ProcessList.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ProcessList.c b/ProcessList.c index 50a9b35d..869bde44 100644 --- a/ProcessList.c +++ b/ProcessList.c @@ -514,6 +514,7 @@ void ProcessList_rebuildPanel(ProcessList* this) { Panel_prune(this->panel); int size = ProcessList_size(this); int idx = 0; + bool foundFollowed = false; for (int i = 0; i < size; i++) { Process* p = ProcessList_get(this, i); @@ -527,12 +528,19 @@ void ProcessList_rebuildPanel(ProcessList* this) { Panel_set(this->panel, idx, (Object*)p); if (this->following != -1 && p->pid == this->following) { + foundFollowed = true; Panel_setSelected(this->panel, idx); this->panel->scrollV = currScrollV; } idx++; } + if (this->following != -1 && !foundFollowed) { + /* Reset if current followed pid not found */ + this->following = -1; + Panel_setSelectionColor(this->panel, PANEL_SELECTION_FOCUS); + } + if (this->following == -1) { /* If the last item was selected, keep the new last item selected */ if (currPos > 0 && currPos == currSize - 1) |