Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listbox no longer scrolls when dragging outside widget #3559

Closed
mc-butler opened this issue Nov 17, 2015 · 6 comments
Closed

Listbox no longer scrolls when dragging outside widget #3559

mc-butler opened this issue Nov 17, 2015 · 6 comments
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/3559
Reporter mooffie (@mooffie)
Mentions egmont (@egmontkob)

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 33d25a0 (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.

@mc-butler
Copy link
Author

Changed by mooffie (@mooffie) on Nov 17, 2015 at 22:11 UTC (comment 1)

(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.)

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Nov 18, 2015 at 7:51 UTC (comment 2)

  • Cc set to egmont

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

@mc-butler
Copy link
Author

Changed by mooffie (@mooffie) on Nov 18, 2015 at 8:18 UTC (comment 2.3)

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.

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Nov 18, 2015 at 11:29 UTC (comment 4)

I see, you're totally right!

@mc-butler
Copy link
Author

Changed by mooffie (@mooffie) on Nov 25, 2015 at 23:18 UTC (comment 5)

  • Blocked by set to #3571

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

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Apr 11, 2016 at 7:53 UTC (comment 6)

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

Fixed in #3571.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: low Minor problem or easily worked around
Development

No branches or pull requests

1 participant