Fixed mouse handling in WPanel widget.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2012-04-10 16:44:28 +04:00 committed by Slava Zanko
parent a878a2dd37
commit 3b86ee7808

View File

@ -3480,7 +3480,7 @@ mark_if_marking (WPanel * panel, Gpm_Event * event)
*/ */
static void static void
mouse_sort_col (Gpm_Event * event, WPanel * panel) mouse_sort_col (WPanel * panel, int x)
{ {
int i; int i;
const char *lc_sort_name = NULL; const char *lc_sort_name = NULL;
@ -3491,7 +3491,7 @@ mouse_sort_col (Gpm_Event * event, WPanel * panel)
for (i = 0, format = panel->format; format != NULL; format = format->next) for (i = 0, format = panel->format; format != NULL; format = format->next)
{ {
i += format->field_len; i += format->field_len;
if (event->x < i + 1) if (x < i + 1)
{ {
/* found column */ /* found column */
lc_sort_name = format->title; lc_sort_name = format->title;
@ -3595,7 +3595,7 @@ do_panel_event (Gpm_Event * event, WPanel * panel, gboolean * redir)
/* sort on clicked column; don't handle wheel events */ /* sort on clicked column; don't handle wheel events */
if (mouse_down && (local.buttons & (GPM_B_UP | GPM_B_DOWN)) == 0 && local.y == 2) if (mouse_down && (local.buttons & (GPM_B_UP | GPM_B_DOWN)) == 0 && local.y == 2)
{ {
mouse_sort_col (event, panel); mouse_sort_col (panel, local.x);
return MOU_NORMAL; return MOU_NORMAL;
} }