mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-24 20:22:11 +03:00
Ticket #1643: menu events handling in file panel in case of invisible menu.
Fixed: when main menu is invisible, pressing mouse button on the first line makes the menu display, even on panel widgets as "<" ".v>". Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
1a64b2a8ff
commit
c422f67bd3
15
src/screen.c
15
src/screen.c
@ -2558,13 +2558,6 @@ do_panel_event (Gpm_Event *event, WPanel *panel, int *redir)
|
||||
const gboolean is_active = dlg_widget_active (panel);
|
||||
const gboolean mouse_down = (event->type & GPM_DOWN) != 0;
|
||||
|
||||
/* rest of the upper frame, the menu is invisible - call menu */
|
||||
if (mouse_down && event->y == 1 && !menubar_visible) {
|
||||
*redir = 1;
|
||||
event->x += panel->widget.x;
|
||||
return (*(the_menubar->widget.mouse)) (event, the_menubar);
|
||||
}
|
||||
|
||||
/* "<" button */
|
||||
if (mouse_down && event->y == 1 && event->x == 2) {
|
||||
directory_history_prev (panel);
|
||||
@ -2583,6 +2576,13 @@ do_panel_event (Gpm_Event *event, WPanel *panel, int *redir)
|
||||
return MOU_NORMAL;
|
||||
}
|
||||
|
||||
/* rest of the upper frame, the menu is invisible - call menu */
|
||||
if (mouse_down && event->y == 1 && !menubar_visible) {
|
||||
*redir = 1;
|
||||
event->x += panel->widget.x;
|
||||
return the_menubar->widget.mouse (event, the_menubar);
|
||||
}
|
||||
|
||||
/* Mouse wheel events */
|
||||
if (mouse_down && (event->buttons & GPM_B_UP)) {
|
||||
if (is_active) {
|
||||
@ -2593,6 +2593,7 @@ do_panel_event (Gpm_Event *event, WPanel *panel, int *redir)
|
||||
}
|
||||
return MOU_NORMAL;
|
||||
}
|
||||
|
||||
if (mouse_down && (event->buttons & GPM_B_DOWN)) {
|
||||
if (is_active) {
|
||||
if (panel->top_file + ITEMS (panel) < panel->count)
|
||||
|
Loading…
Reference in New Issue
Block a user