From d83948ed09039864cdaf6066a1bd64476211ecaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Thu, 20 Oct 2022 20:08:25 +0200 Subject: Check for action flags correctly Actions are not simple flags with a single bit set, but might have multiple bits set for implying actions. Do not handle an action if only an implying bit is set. Fixes: edc3de7cb597 ("Action: specify implication in code not in comments") --- MainPanel.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'MainPanel.c') diff --git a/MainPanel.c b/MainPanel.c index b231fbcb..89b4e7d4 100644 --- a/MainPanel.c +++ b/MainPanel.c @@ -122,28 +122,28 @@ static HandlerResult MainPanel_eventHandler(Panel* super, int ch) { } } - if (reaction & HTOP_REDRAW_BAR) { + if ((reaction & HTOP_REDRAW_BAR) == HTOP_REDRAW_BAR) { MainPanel_updateLabels(this, settings->ss->treeView, this->state->pl->incFilter); } - if (reaction & HTOP_RESIZE) { + if ((reaction & HTOP_RESIZE) == HTOP_RESIZE) { result |= RESIZE; } - if (reaction & HTOP_UPDATE_PANELHDR) { + if ((reaction & HTOP_UPDATE_PANELHDR) == HTOP_UPDATE_PANELHDR) { result |= REDRAW; } - if (reaction & HTOP_REFRESH) { + if ((reaction & HTOP_REFRESH) == HTOP_REFRESH) { result |= REFRESH; } - if (reaction & HTOP_RECALCULATE) { + if ((reaction & HTOP_RECALCULATE) == HTOP_RECALCULATE) { result |= RESCAN; } - if (reaction & HTOP_SAVE_SETTINGS) { + if ((reaction & HTOP_SAVE_SETTINGS) == HTOP_SAVE_SETTINGS) { this->state->settings->changed = true; } - if (reaction & HTOP_QUIT) { + if ((reaction & HTOP_QUIT) == HTOP_QUIT) { return BREAK_LOOP; } - if (!(reaction & HTOP_KEEP_FOLLOWING)) { + if ((reaction & HTOP_KEEP_FOLLOWING) != HTOP_KEEP_FOLLOWING) { this->state->pl->following = -1; Panel_setSelectionColor(super, PANEL_SELECTION_FOCUS); } -- cgit v1.2.3