Repository navigation
Conversation
ImGui 1.92.9 with ConfigMacOSXBehaviors (its default on Apple) swaps Cmd and Ctrl in AddKeyEvent, so a host sends Cmd as ImGuiMod_Super. The overlay sent VTK's control flag as ImGuiMod_Ctrl, which became Super: - VTK's own window: its Cocoa view sets the one control flag for Cmd or Ctrl (vtkCocoaGLView.mm). Cmd+Z did not undo and typed a "z", since ImGui drops characters only under its own Ctrl. Under Mac behaviours the flag (and its Control_L/R) now goes in as Super. - cvcGL's SDL3 window dropped the GUI key. SdlRenderWindowInteractor's GetSuperKey() now carries SDL_KMOD_GUI, and the overlay hands ImGui Ctrl and Super as they are, as imgui_impl_sdl3 does. cvcgl_imgui_overlay_keys drives a real overlay through a VTK interactor with Mac behaviours forced on and off, with no window and no GL. cvcgl_sdl_attach checks the GUI key on SDL's window and through the overlay. ARIADNE.md says what pick mods mean on a Mac.
transfix
enabled auto-merge (squash)
November 25, 2026 08:40
transfix
disabled auto-merge
November 25, 2026 08:41
This was referenced Nov 25, 2026
On Windows imgui is linked into cvcGL and into each test, each with its own current context. cvcgl_imgui_overlay_keys and cvcgl_sdl_attach set only cvcGL's (ImGuiBackend::setImGuiContext), so their own ImGui calls asserted on "No current context" (exit 0xc0000409 on package-windows). They now set both, as cvcgl_imgui_touch_scroll does.
transfix
added a commit
that referenced
this pull request
Nov 26, 2026
#1539) Includes #1536 (the native fix), which #1539 was stacked on. - VTK's own window: its Cocoa view sets one control flag for Cmd or Ctrl. Under ImGui's Mac behaviours that flag now goes in as ImGuiMod_Super, which ImGui swaps to its shortcut key. Sent as Ctrl, Cmd+Z did not undo and Cmd+C typed a "c". - cvcGL's SDL window carries the GUI key as SdlRenderWindowInteractor::GetSuperKey(), and the overlay hands ImGui Ctrl and Super as they are. - In a browser (no __APPLE__), the overlay turns on Mac behaviours from the page's platform; ?mackeys=1|0 overrules it. - A Mac sends no key-up for a key let go while Cmd is down. Under Cmd a press is now a tap, and Cmd's release lets go of any key still down. - Tests: cvcgl_imgui_overlay_keys (no GL, no display), cvcgl_sdl_attach's Cmd/Ctrl checks, cvcgl_imgui_key_names' platform names, and arigl_web_mac_keys.mjs in CI's arigl-web job.
Owner
Author
|
Included in #1539, which was stacked on this PR and squash-merged to master as 7ded735 with Joe's OK ("merge 1539"). That commit has both of this PR's commits: the native Cmd/Ctrl fix and the Windows ImGui-context test fix. On the ci/full runs, the new tests passed on all four macOS lanes; the only macOS failures there were cvcgl_imgui_context_menu and cvcgl_ari_golden, which #1526 fixed. master's own push run will check macOS on the merged code. Closing as included. |
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.
On a Mac, ImGuiOverlay passed ImGui the wrong modifier for Cmd, in both of cvcGL's windows. So Cmd+Z, C, V, X and A probably did nothing in an ImGui field, and in VTK's window Cmd+C probably typed a "c". No one has run this on a real Mac yet. The CI evidence is listed under Tests.
The bug
ImGui 1.92.9 with
io.ConfigMacOSXBehaviorsswaps Cmd and Ctrl insideAddKeyEvent. That setting is on by default on Apple. After the swap, ImGui'sImGuiMod_Ctrlis its shortcut key: the oneShortcut(ImGuiMod_Ctrl | ImGuiKey_Z)and InputText's undo look for. A host has to send Cmd asImGuiMod_Super, and ImGui turns it into Ctrl.vtkCocoaGLView.mm:241, the same in VTK 9.5 and master) has one control flag, set for Cmd or Ctrl. The overlay sent it asImGuiMod_Ctrl, and ImGui swapped it to Super. So Cmd+Z did not undo. ImGui drops typed characters only under its own Ctrl, so the "z" that Cocoa sends with Cmd+Z went into the field. Physical Ctrl+Z did nothing either, because its ^Z is filtered out.SDL_KMOD_CTRLonly and dropped the GUI key (Cmd).The fix
ImGuiOverlay.cpp, VTK's window: underConfigMacOSXBehaviorsthe control flag goes in asImGuiMod_Super, which ImGui turns into its shortcut key.Control_L/Control_Rgo in asLeftSuper/RightSuperto match. With Mac behaviours off, nothing changes. This is the same change macOS CI: contour_tiler's macOS golden, Cmd+Z in the context-menu test, ci/full for new goldens #1526 made to the context-menu test's undo step.SdlWindow:SdlRenderWindowInteractor::GetSuperKey()carriesSDL_KMOD_GUI, since VTK has no flag for it. On SDL's window the overlay passes Ctrl asImGuiMod_Ctrland GUI asImGuiMod_Super, the way imgui_impl_sdl3 does, and ImGui swaps them on a Mac. On other platforms the GUI key (the Windows key, a browser's Meta) now reaches ImGui as Super, and no ImGui shortcut uses Super there.Other changes on a Mac (also unverified on a real Mac)
modsare ImGui'sio.KeyCtrl/io.KeySuper, so Cmd now reportsctrl. Before, it reportedsuperunder VTK's window and nothing under SDL's. Physical Ctrl reportssuperunder SDL's window andctrlunder VTK's. ARIADNE.md now says what the mods mean on a Mac.Checked and left alone
ImGuiBackend.cpp'smod()menu labels already say "Cmd+" underConfigMacOSXBehaviors, and that now matches what works.ConfigMacOSXBehaviorsis off, because__APPLE__is not defined. So Ctrl stays the shortcut key in a browser on a Mac, and the labels say "Ctrl+". VTK's canvas interactor readsctrlKeyonly. Making Cmd the shortcut there means reading the page's platform and checking the browser's paste event under Cmd+V, so it is left as a follow-up.SdlInput.cpp:117builds SDL-style modifiers from VTK's window for app input, not for ImGui. Cmd still arrives there as LCTRL.Tests
cvcgl_imgui_overlay_keys, which needs no GL and no Mac and runs on every lane. It builds a real ImGuiOverlay on an offscreen view with an uninitialized VTK interactor, and runs ImGui's frames on the overlay's own context.ImGuiMod_Ctrl+Z straight to ImGui, which is what the overlay used to send. It does not undo with Mac behaviours on, and does with them off.cvcgl_sdl_attach, on a real SDL window (Xvfb on package-linux), gains these checks:GetSuperKeyand leaves the control flag clear. Ctrl+Z sets only the control flag.Local results (Linux, Release, phm; cvcpkg's Xvfb and Mesa for the SDL window):
cvcgl_imgui_overlay_keyspasses 11 of 11, with a display and without one.'abcz'and Cmd+A types an "a": the symptom described above, reproduced.cvcgl_sdl_attachpasses, and fails 4 of its new checks against master's overlay.cvcgl_imgui_*,cvcgl_sdl_*,cvcgl_camera_sdl_fly,cvcgl_ariadne_pick,cvcgl_ariadne_node_pickandcvcgl_tf_editorset.macOS: PRs skip the macOS package lanes, so the same commit is also pushed to
ci/full/imgui-overlay-macos-mods: CI/CD run 45577628329. There,cvcgl_imgui_overlay_keysruns with ImGui's default, so Mac behaviours are on from__APPLE__and the test forces them both ways. No one has pressed Cmd+Z on a real Mac yet.Don't merge this without Joe's OK.