Skip to content

fix map3d on macOS - #1720

Merged
tridge merged 3 commits into
ArduPilot:masterfrom
tridge:pr-map3d-macos
Aug 1, 2026
Merged

fix map3d on macOS#1720
tridge merged 3 commits into
ArduPilot:masterfrom
tridge:pr-map3d-macos

Conversation

@tridge

@tridge tridge commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Two macOS bugs in the 3D map, plus a hardening fix that came out of review.

Toolbar was unusable. Map3DFrame called SetSizer() but never Layout(),
so every child stayed at wx's default (-1,-1) and the VTK canvas kept its own
default 1100x800, covering the controls. On macOS only fragments of the buttons
showed; on GTK with wx 4.0.7 the row had no height at all. Only MSW laid out on
its own, which is why Windows looked fine. Layout() is used rather than
Fit()/SetSizerAndFit() because those let the canvas's best size change the
caller's requested frame size.

Rotate did not work. TerrainStyle began a drag only on
LeftButtonPressEvent and required GetControlKey(). macOS Cocoa converts
Ctrl+left-click into a right click, so that press never arrived and only panning
worked. A right drag now rotates as well as Ctrl+drag.

Drag ownership. Adding the right button exposed that either release ended
whichever drag was running, and a second press could switch pan/rotate under the
first. A drag left unfinished - interaction disabled part way through for FPV, or
a release never seen - also kept moving the camera on plain mouse motion. Each
drag now has one owning button, with cancel_drag() called where interaction is
disabled.

Tested on macOS 26.3 arm64 (Python 3.14, wxPython 4.3.1 osx-cocoa, VTK 9.6.2,
spawn start method) against live SITL telemetry, with pan and rotate confirmed by
hand. Layout geometry checked on macOS, GTK and Windows; drag state transitions
covered by synthetic VTK events.

tridge added 3 commits August 1, 2026 13:45
SetSizer alone leaves the children at their default position, so the VTK
canvas kept its own size and covered the controls. MSW lays out on its own
so Windows looked right, but on macOS only fragments of the buttons showed
and on GTK the row had no height at all.
macOS turns Ctrl+left-click into a right click, so the Ctrl+drag binding
never reached the interactor there and only panning worked
either release used to end whichever drag was running, and a second press
could switch pan and rotate under the first. A drag left unfinished, by
disabling interaction part way through or a release we never saw, also kept
moving the camera on plain mouse motion.
@tridge
tridge merged commit 2abf777 into ArduPilot:master Aug 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant