mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
Make 'c' key work with threads as well.
This commit is contained in:
parent
b9934ffa08
commit
e3f65c8ec2
2
Action.c
2
Action.c
@ -142,7 +142,7 @@ static void tagAllChildren(Panel* panel, Process* parent) {
|
||||
pid_t ppid = parent->pid;
|
||||
for (int i = 0; i < Panel_size(panel); i++) {
|
||||
Process* p = (Process*) Panel_get(panel, i);
|
||||
if (!p->tag && p->ppid == ppid) {
|
||||
if (!p->tag && Process_isChildOf(p, ppid)) {
|
||||
tagAllChildren(panel, p);
|
||||
}
|
||||
}
|
||||
|
@ -172,6 +172,8 @@ typedef struct ProcessClass_ {
|
||||
|
||||
#define As_Process(this_) ((ProcessClass*)((this_)->super.klass))
|
||||
|
||||
#define Process_isChildOf(process_, pid_) (process_->tgid == pid_ || (process_->tgid == process_->pid && process_->ppid == pid_))
|
||||
|
||||
}*/
|
||||
|
||||
static int Process_getuid = -1;
|
||||
|
@ -151,6 +151,8 @@ typedef struct ProcessClass_ {
|
||||
|
||||
#define As_Process(this_) ((ProcessClass*)((this_)->super.klass))
|
||||
|
||||
#define Process_isChildOf(process_, pid_) (process_->tgid == pid_ || (process_->tgid == process_->pid && process_->ppid == pid_))
|
||||
|
||||
|
||||
#define ONE_K 1024L
|
||||
#define ONE_M (ONE_K * ONE_K)
|
||||
|
@ -173,7 +173,7 @@ static void ProcessList_buildTree(ProcessList* this, pid_t pid, int level, int i
|
||||
|
||||
for (int i = Vector_size(this->processes) - 1; i >= 0; i--) {
|
||||
Process* process = (Process*) (Vector_get(this->processes, i));
|
||||
if (process->show && (process->tgid == pid || (process->tgid == process->pid && process->ppid == pid))) {
|
||||
if (process->show && Process_isChildOf(process, pid)) {
|
||||
process = (Process*) (Vector_take(this->processes, i));
|
||||
Vector_add(children, process);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user