aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-10-02 05:12:13 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2016-10-02 05:12:13 +0200
commit5f348ccb3349e63c3dccfd10e82973588da2be7a (patch)
treeb02b5b7aa912f3d0e38fa59bd81fb42750957cdb
parent400edb58cb28dd7bd7ce9822a0065be9bdd13583 (diff)
downloadnncmpp-5f348ccb3349e63c3dccfd10e82973588da2be7a.tar.gz
nncmpp-5f348ccb3349e63c3dccfd10e82973588da2be7a.tar.xz
nncmpp-5f348ccb3349e63c3dccfd10e82973588da2be7a.zip
Ignore mouse clicks in deaf parts of the header
-rw-r--r--nncmpp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/nncmpp.c b/nncmpp.c
index b0eeda3..f384e3c 100644
--- a/nncmpp.c
+++ b/nncmpp.c
@@ -1235,7 +1235,8 @@ app_process_left_mouse_click (int line, int column)
{
struct tab *tab = g_ctx.active_tab;
int row_index = line - g_ctx.top_height;
- if (row_index >= (int) tab->item_count - tab->item_top)
+ if (row_index < 0
+ || row_index >= (int) tab->item_count - tab->item_top)
return;
tab->item_selected = row_index + tab->item_top;