feat: command for mac binds - #220
Draft
seankmartin wants to merge 5 commits into
Draft
Conversation
Under Wayland, neither Firefox nor Chrome report changes to modifier keys during drag events. Chrome reports modifiers for the initial `dragstart` event and no modifiers for the subsequent events (https://issues.chromium.org/issues/40138974). Firefox saves the modifiers that were pressed during the initial `dragstart` and continues to report the same modifiers for all subsequent events. Previously, Neuroglancer determined the drop effect based on the modifier keys reported to the `dragover` event, and under Linux Wayland on Chrome no modifiers are ever reported. With this change, the Firefox behavior under Wayland is essentially emulated on Chrome: the modifiers reported to `dragstart` are saved and apply throughout the drag event (even if the user later releases them). This commit also updates the drag status message to indicate the Wayland-specific limitations when Wayland is detected. Additionally, Chrome under Wayland sets `effectAllowed` to `copyMove` rather than `all` by default. Previously, in cases such as dropping a layer onto a drop zone in order to create a new layer group, Neuroglancer selected a default dropEffect of `link`, which led to the drop being rejected by Chrome. This commit fixes that problem by reporting a fake dropEffect, if necessary, to ensure it is one of the values allowed by `effectAllowed`. Regardless of the reported drop effect, the correct drop operation is still performed.
(cherry picked from commit d96fa6a)
Show Cmd rather than Ctrl in tooltips describing modifier+click bindings, matching what the Cmd-as-Ctrl remap in dispatchEventWithModifiers makes the user actually press. Left untouched: layer_bar.ts, segmentation_display_state/frontend.ts, and drag_and_drop.ts have Ctrl/Alt-only click handlers with no Cmd/Option equivalent implemented at all; fixing those requires adding new functional behavior. (cherry picked from commit 0305e21)
getDropEffectFromModifiers accepted only Ctrl to force a "move" drop, which is unusable on Mac where Ctrl+click is the system secondary-click gesture. Accept Cmd there instead, and name the modifier accordingly in the drag status message. savedModifiers already captured metaKey, so the Wayland workaround needs no change. The segment list and add-layer tooltips were label-only: Option and Cmd already worked, the text just named the wrong keys. The tool palette dropdown button advertised "control+click to create new", but its CheckboxIcon ignores modifiers and no create-new path exists, so the hint was inaccurate on every platform. Drop it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is missing various fixes we later added and is just the starting point