Ticket #3722: mc-3722-prevent-execute-last-element-on-empty-area.patch

File mc-3722-prevent-execute-last-element-on-empty-area.patch, 1.1 KB (added by and, 3 years ago)
  • src/filemanager/panel.c

    From b5e3bfd163835d9c904f179a3145896643852348 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Tue, 6 Dec 2016 22:51:51 +0000
    Subject: [PATCH] Prevent execute last item on empty area
    
    As pointed out by egmont (#3722) prevent execute of last item when
    clicking on empty area by accident.
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/filemanager/panel.c | 8 +++++---
     1 file changed, 5 insertions(+), 3 deletions(-)
    
    diff --git a/src/filemanager/panel.c b/src/filemanager/panel.c
    index d2c6cc6..f50bf14 100644
    a b panel_mouse_callback (Widget * w, mouse_msg_t msg, mouse_event_t * event) 
    39053906    case MSG_MOUSE_CLICK: 
    39063907        if ((event->count & GPM_DOUBLE) != 0) 
    39073908        { 
    3908             int y, lines; 
     3909            int y, lines, last; 
    39093910 
    39103911            y = event->y - 2; 
    39113912            lines = panel_lines (panel); 
     3913            last = panel->dir.len; 
    39123914 
    3913             if (y >= 0 && y < lines) 
     3915            if (y >= 0 && y < lines && panel->top_file + y < last) 
    39143916                do_enter (panel); 
    39153917        } 
    39163918        break;