Ticket #3559 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

Listbox no longer scrolls when dragging outside widget

Reported by: mooffie Owned by:
Priority: minor Milestone: 4.8.17
Component: mc-core Version: master
Keywords: Cc: egmont
Blocked By: #3571 Blocking:
Branch state: no branch Votes for changeset:

Description

The listbox widget contains code that makes it possible to scroll the list by dragging the mouse outside (above or below) the widget. Here is its gist:

static int
listbox_event (Gpm_Event * event, void *data)
{
    ...
    ...

    if ((event->type & (GPM_DOWN | GPM_DRAG)) != 0)
    {
        Gpm_Event local;
        ...

        local = mouse_get_local (event, w);
        if (local.y < 1)
            /* scroll up */
        else if (local.y > w->lines)
            /* scroll down */

However, this feature stopped working with commit 33d25a0c8f (from 2011), which added the following two lines at the start of the mouse handler:

    if (!mouse_global_in_widget (event, w))
        return MOU_UNHANDLED;

I.e., if the mouse is outside the widget, the function exits. So the function no longer sees dragging events occurring outside the widget.

Change History

comment:1 Changed 10 years ago by mooffie

(I don't know why the code I quoted is shown jumbled. I did use "{{{...}}}". If anybody figures out what's the problem let me know so I won't repeat it in the future.)

Last edited 10 years ago by mooffie (previous) (diff)

comment:2 follow-up: ↓ 3 Changed 10 years ago by egmont

  • Cc egmont added

Do you really mean dragging, not scrolling? What do you do exactly? Do you click inside the widget and then move it out?

comment:3 in reply to: ↑ 2 Changed 10 years ago by mooffie

Replying to egmont:

What do you do exactly?


To see the problem, open a dialog containing a listbox with gazillion items. E.g., open the editor and choose "Syntax highlighting..." from the "Options" menu. The listbox there is huge.

Now:

  • Hold down the left mouse button over an item. Don't release it.
  • Move the mouse down (an action called "dragging") past the listbox's south border.

The listbox should now start scrolling. It doesn't.

Last edited 10 years ago by mooffie (previous) (diff)

comment:4 Changed 10 years ago by egmont

I see, you're totally right!

comment:5 Changed 10 years ago by mooffie

  • Blocked By 3571 added

This bug vanishes if ticket:3571 gets accepted (see comment 2 there).

comment:6 Changed 10 years ago by andrew_b

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from Future Releases to 4.8.17

Fixed in #3571.

Note: See TracTickets for help on using tickets.