Ticket #3559 (closed defect: fixed)
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:2 follow-up: ↓ 3 Changed 9 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 9 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.
comment:5 Changed 9 years ago by mooffie
- Blocked By 3571 added
This bug vanishes if ticket:3571 gets accepted (see comment 2 there).
(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.)