Skip to content

feat: command for mac binds - #220

Draft
seankmartin wants to merge 5 commits into
masterfrom
feat/mac-use-command-for-control-binds
Draft

feat: command for mac binds#220
seankmartin wants to merge 5 commits into
masterfrom
feat/mac-use-command-for-control-binds

Conversation

@seankmartin

@seankmartin seankmartin commented Aug 12, 2026

Copy link
Copy Markdown

This is missing various fixes we later added and is just the starting point

  • fix(drag_and_drop): Fix drag and drop issues under Wayland
  • feat: add cmd for control binds

jbms and others added 5 commits August 12, 2026 06:00
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.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants