From 19b514168553c75a3d5a012b781efbfd00fccc08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 23 Nov 2020 16:23:18 +0100 Subject: Hide process selection on ESC Do not highlight the current process line after pressing ESC in the main screen. Restore after pressing any key. --- MainPanel.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'MainPanel.c') diff --git a/MainPanel.c b/MainPanel.c index 6a9d6303..848deae9 100644 --- a/MainPanel.c +++ b/MainPanel.c @@ -57,6 +57,9 @@ static HandlerResult MainPanel_eventHandler(Panel* super, int ch) { Htop_Reaction reaction = HTOP_OK; + if (ch != ERR) + this->state->hideProcessSelection = false; + if (EVENT_IS_HEADER_CLICK(ch)) { int x = EVENT_HEADER_CLICK_GET_X(ch); const ProcessList* pl = this->state->pl; @@ -83,6 +86,7 @@ static HandlerResult MainPanel_eventHandler(Panel* super, int ch) { } result = HANDLED; } else if (ch == 27) { + this->state->hideProcessSelection = true; return HANDLED; } else if (ch != ERR && ch > 0 && ch < KEY_MAX && this->keys[ch]) { reaction |= (this->keys[ch])(this->state); -- cgit v1.2.3