fix map3d on macOS - #1720
Merged
Merged
Conversation
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.
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.
Two macOS bugs in the 3D map, plus a hardening fix that came out of review.
Toolbar was unusable.
Map3DFramecalledSetSizer()but neverLayout(),so every child stayed at wx's default
(-1,-1)and the VTK canvas kept its owndefault 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 thanFit()/SetSizerAndFit()because those let the canvas's best size change thecaller's requested frame size.
Rotate did not work.
TerrainStylebegan a drag only onLeftButtonPressEventand requiredGetControlKey(). macOS Cocoa convertsCtrl+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 isdisabled.
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.