]> granicus.if.org Git - procps-ng/commit
top: ensure those potential focused tasks stay focused
authorJim Warner <james.warner@comcast.net>
Thu, 23 Sep 2021 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Sun, 26 Sep 2021 04:47:21 +0000 (14:47 +1000)
commit69978e365043f27305e487709474947bb377084d
treed62139321795bede20d04f592c82bab133e9a9c8
parentf11f43b4f7118f284f9aec19f6885d163848ffe7
top: ensure those potential focused tasks stay focused

When that 'F' focus command has been applied to a task
in forest view it should remain as the topmost process
in a particular window. But without this patch that is
not guaranteed. Newly forked/cloned tasks 'above' such
a process result in task(s) appearing which shouldn't.

The effect was as if that up arrow key scrolled beyond
the topmost parent task, which would never be allowed.

[ since scrolling is permitted within a focus range, ]
[ when any task 'above' our focus/topmost task ends, ]
[ we respond as if scrolled with the down arrow key. ]

[ that result is completely appropriate. if the user ]
[ wishes to return to a focused parent, the up arrow ]
[ or home key can be used to accomplish such a goal. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c