mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Ticket #54: fix of dialog mouse handling.
Skip widgets that matches coords but does not have an action (usually groupboxes), continuing search of widget with defined action. Thanks to sfionov. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
520e141844
commit
57f9d0e042
22
src/dialog.c
22
src/dialog.c
@ -752,22 +752,20 @@ dlg_mouse_event (Dlg_head * h, Gpm_Event * event)
|
|||||||
|
|
||||||
item = starting_widget;
|
item = starting_widget;
|
||||||
do {
|
do {
|
||||||
Widget *widget = item;
|
Widget *widget;
|
||||||
|
|
||||||
|
widget = item;
|
||||||
item = item->next;
|
item = item->next;
|
||||||
|
|
||||||
if (!((x > widget->x) && (x <= widget->x + widget->cols)
|
if ((x > widget->x) && (x <= widget->x + widget->cols)
|
||||||
&& (y > widget->y) && (y <= widget->y + widget->lines)))
|
&& (y > widget->y) && (y <= widget->y + widget->lines)) {
|
||||||
continue;
|
new_event = *event;
|
||||||
|
new_event.x -= widget->x;
|
||||||
|
new_event.y -= widget->y;
|
||||||
|
|
||||||
new_event = *event;
|
if (widget->mouse != NULL)
|
||||||
new_event.x -= widget->x;
|
return widget->mouse (&new_event, widget);
|
||||||
new_event.y -= widget->y;
|
}
|
||||||
|
|
||||||
if (!widget->mouse)
|
|
||||||
return MOU_NORMAL;
|
|
||||||
|
|
||||||
return (*widget->mouse) (&new_event, widget);
|
|
||||||
} while (item != starting_widget);
|
} while (item != starting_widget);
|
||||||
|
|
||||||
return MOU_NORMAL;
|
return MOU_NORMAL;
|
||||||
|
Loading…
Reference in New Issue
Block a user