Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Context menu disables click and pan gesture recognizers #5078

Closed
kkaefer opened this issue May 20, 2016 · 10 comments
Closed

Context menu disables click and pan gesture recognizers #5078

kkaefer opened this issue May 20, 2016 · 10 comments
Labels
archived Archived because of inactivity bug macOS Mapbox Maps SDK for macOS

Comments

@kkaefer
Copy link
Member

kkaefer commented May 20, 2016

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

@kkaefer kkaefer added bug macOS Mapbox Maps SDK for macOS labels May 20, 2016
@1ec5
Copy link
Contributor

1ec5 commented May 23, 2016

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

@1ec5 1ec5 changed the title OS X: Context menu disables mouse handlers Context menu disables click and pan gesture recognizers May 23, 2016
@kkaefer
Copy link
Member Author

kkaefer commented Jul 6, 2016

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

@1ec5
Copy link
Contributor

1ec5 commented Jul 6, 2016

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

@1ec5
Copy link
Contributor

1ec5 commented Jul 6, 2016

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
Copy link
Member Author

kkaefer commented Jul 6, 2016

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

@1ec5
Copy link
Contributor

1ec5 commented Jul 6, 2016

#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 pushed a commit that referenced this issue Jul 7, 2016
NSView’s built-in context menu handling preempts non-right-click gesture recognizers, so preempt it with a right-click gesture recognizer that does essentially the same thing. With this change, two-finger double-tapping on a trackpad also zooms out, consistent with MapKit.

Fixes #5078.
@kkaefer
Copy link
Member Author

kkaefer commented Sep 6, 2016

I'm seeing this issue again.

@kkaefer kkaefer reopened this Sep 6, 2016
@kkaefer
Copy link
Member Author

kkaefer commented Sep 6, 2016

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
Copy link
Contributor

1ec5 commented Sep 6, 2016

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

@stale stale bot added the archived Archived because of inactivity label Nov 18, 2018
@stale
Copy link

stale bot commented Nov 20, 2018

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

@stale stale bot closed this as completed Nov 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived Archived because of inactivity bug macOS Mapbox Maps SDK for macOS
Projects
None yet
Development

No branches or pull requests

2 participants