mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.37k stars 1.33k forks source link

Context menu disables click and pan gesture recognizers #5078

Closed kkaefer closed 5 years ago

kkaefer commented 8 years ago

After bringing up the context menu, and subsequently dismissing it, panning and rotation with the mouse does not work anymore.

This only happens when using the right mouse button of a physical mouse, or the two-finger tap on a trackpad, but NOT when using Ctrl+Tap or Ctrl+Left Click.

Zooming still works with the keyboard, the trackpad, or the mouse scrollwheel.

The map can be panned again after using pinch-to-zoom.

/cc @1ec5

1ec5 commented 8 years ago

Minimizing and restoring the window also unbreaks click and drag events. So does rotating the map with two fingers.

kkaefer commented 8 years ago

@1ec5 any ideas on this? I'm hitting this frequently during debugging.

1ec5 commented 8 years ago

This is pretty bizarre. We might have to fix it by replacing the gesture recognizers with the older mouse event API.

1ec5 commented 8 years ago

Raw event handlers like -mouseDragged do work even after opening the context menu. But that doesn’t completely solve the problem: developers expect to be able to attach an NSPressGestureRecognizer, for instance, to the map without resorting to raw event handling.

kkaefer commented 8 years ago

@1ec5 well, can we trigger what ever is run by the pinch-to-zoom or window-minification to restore mouse handlers?

1ec5 commented 8 years ago

5593 fixes this issue. Now it kind of makes sense why this bug appeared in the first place: context menu handling relies on raw mouse events instead of gesture recognizers. Hopefully that’s the only edge case we need to worry about.

kkaefer commented 8 years ago

I'm seeing this issue again.

kkaefer commented 8 years ago

This time, a right click disables panning both for USB mice and trackpad. Pinch zooming on the trackpad resets the lock and panning works again.

Right clicking opens the context menu. Dismissing it by left clicking somewhere else on the map triggers the bug. I could trigger the bug both with a USB mouse and clicking on the trackpad. It doesn't seem to trigger every time I open the context menu, but frequently enough.

1ec5 commented 8 years ago

I can’t reproduce this issue in macosapp as of 4eb54270d773bf60f948176c3ff7827d7f818a92. I tried control-tapping and two-finger tapping with a multitouch trackpad, as well as right-clicking with a standard USB mouse.

stale[bot] commented 5 years ago

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.