diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2012-02-02 23:45:40 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2012-02-02 23:45:40 +0000 |
commit | 1a604a05a5ab67949adfcf3d138c6c22d36bd511 (patch) | |
tree | 7b5f7268c454336953b5b9b3442e3f38043767c2 /ProcessList.c | |
parent | 58676d70010f93f65a10945c45bd0910204a203a (diff) |
BUGFIX: behavior of 'F' (follow) key was broken, also affecting the
persistence of mouse selections. Closes #3165065.
Diffstat (limited to 'ProcessList.c')
-rw-r--r-- | ProcessList.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/ProcessList.c b/ProcessList.c index 04f761c6..1f47408b 100644 --- a/ProcessList.c +++ b/ProcessList.c @@ -109,7 +109,7 @@ typedef struct ProcessList_ { UsersTable* usersTable; Panel* panel; - bool follow; + int following; bool userOnly; uid_t userId; bool filtering; @@ -899,15 +899,15 @@ void ProcessList_expandTree(ProcessList* this) { } } -void ProcessList_rebuildPanel(ProcessList* this, bool flags, bool follow, bool userOnly, uid_t userId, bool filtering, const char* incFilter) { +void ProcessList_rebuildPanel(ProcessList* this, bool flags, int following, bool userOnly, uid_t userId, bool filtering, const char* incFilter) { if (!flags) { - follow = this->follow; + following = this->following; userOnly = this->userOnly; userId = this->userId; filtering = this->filtering; incFilter = this->incFilter; } else { - this->follow = follow; + this->following = following; this->userOnly = userOnly; this->userId = userId; this->filtering = filtering; @@ -915,10 +915,8 @@ void ProcessList_rebuildPanel(ProcessList* this, bool flags, bool follow, bool u } int currPos = Panel_getSelectedIndex(this->panel); - pid_t currPid = 0; + pid_t currPid = following ? following : 0; int currScrollV = this->panel->scrollV; - if (follow) - currPid = ProcessList_get(this, currPos)->pid; Panel_prune(this->panel); int size = ProcessList_size(this); @@ -934,7 +932,7 @@ void ProcessList_rebuildPanel(ProcessList* this, bool flags, bool follow, bool u if (!hidden) { Panel_set(this->panel, idx, (Object*)p); - if ((!follow && idx == currPos) || (follow && p->pid == currPid)) { + if ((following == -1 && idx == currPos) || (following != -1 && p->pid == currPid)) { Panel_setSelected(this->panel, idx); this->panel->scrollV = currScrollV; } |