github ocornut/imgui v1.90.7

latest releases: v1.91.5-docking, v1.91.5, v1.91.4-docking...
5 months ago

1.90.7: Shortcuts, input routing, OSX mods & ctrl+left click.

Reading the changelog is a good way to keep up to date with the things Dear ImGui has to offer, and maybe will give you ideas of some features that you've been ignoring until now!

📣 Click version number above to display full release note contents, otherwise it is clipped by GitHub!


Links: Homepage - Release notes - FAQ - Issues, Q&A
Also see our Wiki with sections such as Getting Started, Useful Extensions Gallery, Software using Dear ImGui, Bindings & Backends and more! 👌

Consider reading the foreword for v1.90.5. If you contacted me in March consider following up :)

Dear ImGui is funded by your contributions and needs them to sustain and grow. We can invoice and accommodate to many situations.
If your company uses Dear ImGui, please reach out. See Funding & Sponsors page. Did you know? If you need an excuse to pay, you may buy licenses for Test Engine and that will contribute to fund Dear ImGui.

In the last years, Dear ImGui has been financially supported by: Aras Pranckevičius / Arkane Lyon / Asobo Studio / Avalanche Studios Group / BeamNG / Blizzard / Esoterica Engine / G3Dvu / Lucid Games / Noel Berry / Mobigame / Planestate Software / Pocketwatch Games / Remedy Entertainment / Supercell / Terrible Toybox / Tuxedo Labs / Wonderland Engine and many individual contributors. Thank you for allowing Dear ImGui to stay on its path.

Special thanks to @cfillion, @GamingMinds-DanielC, @PathogenDavid & more for for their help with patches and answers!

Changes

Breaking Changes:

  • Inputs: on macOS X, Cmd and Ctrl keys are now automatically swapped by io.AddKeyEvent(), as this naturally align with how macOS X uses those keys. (#2343, #4084, #5923, #456)
    • Effectively it means that e.g. ImGuiMod_Ctrl | ImGuiKey_C is a valid idiomatic shortcut for both Windows and Mac style users.
    • It shouldn't really affect your code unless you had explicit/custom shortcut swapping in place for macOS X apps in your input logic.
    • Removed ImGuiMod_Shortcut which was previously dynamically remapping to Ctrl or Cmd/Super. It is now unnecessary to specific cross-platform idiomatic shortcuts. Kept symbols redirecting ImGuiMod_Shortcut to ImGuiMod_Ctrl (will obsolete).
  • Commented out obsolete symbols renamed in 1.88 (May 2022):
    • CaptureKeyboardFromApp() -> SetNextFrameWantCaptureKeyboard()
    • CaptureMouseFromApp() -> SetNextFrameWantCaptureMouse()
  • Backends: SDL_Renderer2/SDL_Renderer3: ImGui_ImplSDLRenderer2_RenderDrawData() and ImGui_ImplSDLRenderer3_RenderDrawData() now takes a SDL_Renderer* parameter. This was previously overlooked from the API but it will allow eventual support for multi-viewports.

Extra Breaking changes IF AND ONLY IF you were using imgui_internal.h versions of Shortcut() or owner-aware versions of IsKeyPressed(), IsKeyChordPressed(), IsMouseClicked() prior to this version.

(Open for details)
  • Inputs (Internals): Renamed ImGuiKeyOwner_None to ImGuiKeyOwner_NoOwner, to make use more explicit and reduce confusion with the fact it is a non-zero value and cannot be a default.
  • Inputs (Internals): Renamed symbols global routes:
    • Renamed ImGuiInputFlags_RouteGlobalLow -> ImGuiInputFlags_RouteGlobal (this is the suggested global route)
    • Renamed ImGuiInputFlags_RouteGlobal -> ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteOverFocused
    • Renamed ImGuiInputFlags_RouteGlobalHigh -> ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteOverFocused | ImGuiInputFlags_RouteOverActive
  • Inputs (Internals): Shortcut(), SetShortcutRouting()`: swapped last two parameters order in function signatures:
    • Before: Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id = 0, ImGuiInputFlags flags = 0);
    • After: Shortcut(ImGuiKeyChord key_chord, ImGuiInputFlags flags = 0, ImGuiID owner_id = 0);
  • Inputs (Internals): owner-aware versions of IsKeyPressed(), IsKeyChordPressed(), IsMouseClicked(): swapped last two parameters order in function signatures:
    • Before: IsKeyPressed(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0);
    • After: IsKeyPressed(ImGuiKey key, ImGuiInputFlags flags, ImGuiID owner_id = 0);
    • Before: IsMouseClicked(ImGuiMouseButton button, ImGuiID owner_id, ImGuiInputFlags flags = 0);
    • After: IsMouseClicked(ImGuiMouseButton button, ImGuiInputFlags flags, ImGuiID owner_id = 0);
  • For several reasons those changes makes sense. They were all made before making some of those API public. Only past users of imgui_internal.h with the extra parameters will be affected. Added asserts for valid flags in various functions to detect some misuses, BUT NOT ALL.

Other Changes

  • Windows: BeginChild(): fixed visibility of fully clipped child windows and tables from Test Engine.
  • Windows: BeginChild(): fixed auto-fit calculation when using either (not both) ResizeX/ResizeY and double-clicking on a border. Calculation incorrectly didn't always account for scrollbar as it assumed the other axis would also be auto-fit. (#1710)
  • Inputs: added shortcut and routing system in public API. (#456, #2637)
    • Most of the infrastructure have been in place for a few versions. Recent changes/fixes allowed to make it public.
    • The general idea is that several callers may register interest in a shortcut, and only one owner gets it.
      • in Parent: call Shortcut(Ctrl+S) // When Parent is focused, only Parent gets the shortcut.
      • in Child1: call Shortcut(Ctrl+S) // When Child1 is focused, only Child1 gets the shortcut (Child1 overrides Parent shortcuts)
      • in Child2: no call // When Child2 is focused, only Parent gets the shortcut.
    • The whole system is order independent, so if Child1 makes its calls before Parent, results will be identical. This is an important property as it facilitate working with foreign code or larger codebase.
    • Added Shortcut() function. e.g. Using ImGui::Shortcut(ImGuiMod_Ctrl | ImGuiKey_C) with default policy:
      • checks that CTRL+C is pressed,
      • and that current window is in focus stack,
      • and that no other requests for CTRL+C have been made from higher priority locations (e.g. deeper in the window/item stack).
    • Added SetNextItemShortcut() to set a shortcut to locally or remotely press or activate an item (depending on specified routing policy: using ImGuiInputFlags_RouteGlobal the item shortcut may be executed even if its window is not in focus stack). Items like buttons are not fully activated, in the sense that they get pressed but another active item, e.g. InputText() won't be deactivated.
    • Added routing policies for Shortcut(), SetNextItemShortcut(): (#456, #2637)
      • ImGuiInputFlags_RouteFocused: focus stack route (default)
      • ImGuiInputFlags_RouteActive: only route to active item
      • ImGuiInputFlags_RouteGlobal: route globally, unless a focus route claim shame shortcut.
      • ImGuiInputFlags_RouteAlways: no routing submission, no routing check.
    • Added other shortcut/routing options: (#456, #2637)
      • ImGuiInputFlags_Repeat: for use by Shortcut() and by upcoming rework of various input functions (which are still internal for now).
      • ImGuiInputFlags_Tooltip: for SetNextItemShortcut() to show a tooltip when hovering item.
      • ImGuiInputFlags_RouteOverFocused: global route takes priority over focus route.
      • ImGuiInputFlags_RouteOverActive: global route takes priority over active item.
      • ImGuiInputFlags_RouteUnlessBgFocused: global route disabled if no imgui window focused.
      • ImGuiInputFlags_RouteFromRootWindow: route evaluated from the point of view of root window rather than current window.
  • Inputs: (OSX) Fixes variety of code which inconsistently required using Ctrl instead of Cmd.
    • e.g. Drags/Sliders now use Cmd+Click to input a value. (#4084)
    • Some shortcuts still uses Ctrl on Mac: e.g. Ctrl+Tab to switch windows. (#4828)
  • Inputs: (OSX) Ctrl+Left Click alias as a Right click. (#2343) [@haldean, @ocornut]
  • Inputs: Fixed ImGui::GetKeyName(ImGuiKey_None) from returning "N/A" or "None" depending on value of IMGUI_DISABLE_OBSOLETE_KEYIO. It always returns "None".
  • Nav: fixed holding Ctrl or gamepad L1 from not slowing down keyboard/gamepad tweak speed. Broken during a refactor refactor for 1.89. Holding Shift/R1 to speed up wasn't broken.
  • Tables: fixed cell background of fully clipped row overlapping with header. (#7575, #7041) [@prabuinet]
  • Demo: Added "Inputs & Focus -> Shortcuts" section. (#456, #2637)
  • Demo: Documents: Added shortcuts and renaming tabs/documents. (#7233)
  • Examples: Win32+DX9,DX10,DX11,DX12: rework main loop to handle minimization and screen locking without burning resources by running unthrottled code. (#2496, #3907, #6308, #7615)
  • Backends: all backends + demo now call IMGUI_CHECKVERSION() to verify ABI compatibility between caller code and compiled version of Dear ImGui. If you get an assert it most likely mean you have a build issue, read comments near the assert. (#7568)
  • Backends: Win32: undo an assert introduced in 1.90.6 which didn't allow WndProc handler to be called before backend initialization. Because of how ::CreateWindow() calls in WndProc it is facilitating to not assert. (#6275) [@MennoVink]
  • Backends, Examples: SDL3: updates for latest SDL3 API changes. (#7580) [@kuvaus, @ocornut]

Changes from 1.90.6 to 1.90.7 related to the Docking branch:

  • Docking: BREAKING changed signature of DockSpaceOverViewport() to allow passing an explicit dockspace id if desired. (#7611)
    • Before: DockSpaceOverViewport(const ImGuiViewport* viewport = NULL, ImGuiDockNodeFlags flags = 0, ...);
    • After: DockSpaceOverViewport(ImGuiID dockspace_id = 0, const ImGuiViewport* viewport = NULL, ImGuiDockNodeFlags flags = 0, ...);
      Simply add a leading 0 to your existing calls to DockSpaceOverViewport() if you have any.
  • Tables: resizing border hit-rect scales according to current monitor dpi scale.

Changes from 1.90.6 to 1.90.7 related to the Range-Select branch: (aimed to merge in 1.91)

  • RangeSelect/MultiSelect: (Breaking) Added current_selection_size argument to BeginMultiSelect(), optional. Required for shortcut routing so we can e.g. have Escape be used to clear selection then to exit child window.
  • RangeSelect/MultiSelect: Box-Select: fix preventing focus. amend determination of scope_hovered for decorated/non-child windows + avoid stealing NavId. (#7424)

image

Gallery

@delhoume: _"Here is my first application using ImGui, still learning a lot. [...] It is a simple but efficient TIFF image viewer specially designed to allow instant display of massive images. [...]
https://github.com/delhoume/qshowtiff.
SCR-20240508-xb2

@slerpxcq: "A WIP character animation editor"
https://github.com/slerpxcq/mma
WeChat Screenshot_20240513210736

@learn-more: "UI for my custom 6502 emulator."
The machine being simulated here is the 6502 computer from Ben Eater (https://eater.net/6502 / https://www.youtube.com/watch?v=XlbPnihCM0E). The software currently running in the emulator is MSBASIC ported for Ben Eater's machine: https://github.com/beneater/msbasic)
image


Also see previous releases details.
Note that GitHub are now clamping release notes sometimes really badly, click on a header/title to read full notes.

Dear ImGui is funded by your contributions and needs them to sustain and grow. We can invoice and accommodate to many situations.
If your company uses Dear ImGui, please reach out (omar AT dearimgui DOT com). See Funding/Sponsors page. Did you know? If you need an excuse to pay, you may buy licenses for Test Engine and that will contribute to fund Dear ImGui.

Don't miss a new imgui release

NewReleases is sending notifications on new releases.