Merge branch '2817_dlg_mouse_fix'

* 2817_dlg_mouse_fix:
  Ticket #2817: fixes of mouse handling in file manager.
This commit is contained in:
Andrew Borodin 2012-06-08 11:25:47 +04:00
commit 2b341397ee
3 changed files with 13 additions and 11 deletions

View File

@ -1597,19 +1597,21 @@ midnight_event (Gpm_Event *event, void *data)
if (event->y == h->y + 1)
{
/* menubar */
if (menubar_visible)
if (menubar_visible || the_menubar->is_active)
ret = ((Widget *) the_menubar)->mouse (event, the_menubar);
else
{
Widget *w;
w = get_panel_widget (0);
ret = w->mouse (event, w);
if (w->mouse != NULL)
ret = w->mouse (event, w);
if (ret == MOU_UNHANDLED)
{
w = get_panel_widget (1);
ret = w->mouse (event, w);
if (w->mouse != NULL)
ret = w->mouse (event, w);
}
if (ret == MOU_UNHANDLED)

View File

@ -3554,24 +3554,24 @@ panel_event (Gpm_Event * event, void *data)
local = mouse_get_local (event, w);
/* 1st line */
if (mouse_down && local.y == 1)
if (local.y == 1)
{
/* "<" button */
if (local.x == 2)
if (mouse_down && local.x == 2)
{
directory_history_prev (panel);
goto finish;
}
/* ">" button */
if (local.x == w->cols - 1)
if (mouse_down && local.x == w->cols - 1)
{
directory_history_next (panel);
goto finish;
}
/* "^" button */
if (local.x >= w->cols - 4 && local.x <= w->cols - 2)
if (mouse_down && local.x >= w->cols - 4 && local.x <= w->cols - 2)
{
directory_history_list (panel);
/* both panels have been redrawn */
@ -3579,7 +3579,7 @@ panel_event (Gpm_Event * event, void *data)
}
/* "." button show/hide hidden files */
if (local.x == w->cols - 5)
if (mouse_down && local.x == w->cols - 5)
{
midnight_dlg->callback (midnight_dlg, NULL, DLG_ACTION, CK_ShowHidden, NULL);
/* both panels have been updated */

View File

@ -636,11 +636,11 @@ tree_event (Gpm_Event * event, void *data)
Widget *w = (Widget *) data;
Gpm_Event local;
/* rest of the upper frame - call menu */
if (tree->is_panel && (event->type & GPM_DOWN) != 0 && event->y == w->owner->y + 1)
if (!mouse_global_in_widget (event, w))
return MOU_UNHANDLED;
if (!mouse_global_in_widget (event, w))
/* rest of the upper frame - call menu */
if (tree->is_panel && (event->type & GPM_DOWN) != 0 && event->y == w->owner->y + 1)
return MOU_UNHANDLED;
local = mouse_get_local (event, w);