Skip to content

Commit

Permalink
Updating docking branch (#6)
Browse files Browse the repository at this point in the history
* MultiSelect: added ImGuiMultiSelectFlags_NoAutoClearOnReselect + tweak flags comments. (#7424)

* MultiSelect: minor tidying up.

Checkbox() was reworked in master effectively fixing render clipping when culled by BoxSelect2d's UnclipMode.

* MultiSelect: added courtesy ImGuiMultiSelectFlags_NavWrapX flag so we can demo this until a nav api is designed.

* MultiSelect: Box-Select: uses SetActiveIdUsingAllKeyboardKeys() to avoid nav interference, much like most drag operations.

* MultiSelect: Box-Select: handle Esc to disable box-select.

This avoid remove a one-frame delay when finishing box-select, where Esc wouldn't be routed to selection but to child.

* MultiSelect: ImGuiSelectionBasicStorage: optimized for smaller insertion amounts in larger sets + fix caling batch select with same value.

* MultiSelect: Better document how TreeNode() is not trivially usable yet.

Will revert when the time is right.

* MultiSelect: added Changelog for the feature. Removed IMGUI_HAS_MULTI_SELECT.

* Demo: moved ExampleTreeNode, ExampleMemberInfo above in the demo file. Tidying up index.

+ change ExampleTreeNode::UID from ImGuiID to int to not suggest that the user ID needs to be of a certain type

* Demo: moved some fields inside a struct.

* Demo: moved menu bar code to its own function.

* MultiSelect: using ImGuiMultiSelectFlags_NoRangeSelect ensure never having to interpolate between two ImGuiSelectionUserData.

* Inputs: added SetItemKeyOwner(ImGuiKey key) in public API. (#456, #2637, #2620, #2891, #3370, #3724, #4828, #5108, #5242, #5641)

* Backends: SDL3: Update for API changes: SDL_GetGamepads() memory ownership change. (#7807)

* TabBar, Style: added style option for the size of the Tab-Bar Overline (#7804)

Amend 21bda2e.

* Added a comment hinting at how to set IMGUI_API for shared librairies on e.g. Linux, macOS (#7806)

* Demo: rework Property Editor.

* Nav: fixed c licking window decorations (e.g. resize borders) from losing focused item when within a child window using ImGuiChildFlags_NavFlattened.

In essence, using ImGuiFocusRequestFlags_RestoreFocusedChild here is a way to reduce changes caused by FocusWindow(), but it could be done more neatly.
See amended "nav_flattened" test.

* Demo: Property Editor: using ImGuiChildFlags_NavFlattened now that a bug is fixed. Fixed static analyzer.

* Backends: SDL3: Update for API changes: SDL_GetDisplays() memory ownership change. (#7809)

* Backends: OpenGL3: Fixed unsupported option warning with apple clang (#7810)

* Backends: OSX: fixed NSAppKitVersion version limit for setWantsBestResolutionOpenGLSurface usage. (#7814)

* Internals, TreeNode: indent all render block into its own scope (aim is to add a is_visible test there later)

* Internals, TreeNode, Selectable: tweak span_all_columns paths for clarity.

* CollapsingHeader: left-side outer extend matches right-side one (moved left by one pixel)

Amend c3a348a

* Debug Log: fixed incorrect checkbox layout when partially clipped., doesn't parse 64-bits hex value as ImGuiID lookups.

* Groups, Tables: fixed EndGroup() failing to correctly capture current table occupied size. (#7543)

See "layout_group_endtable" test.

* MultiSelect: sequential SetRange merging not generally handled by box-select path, useful for others.

* MultiSelect: add internal MultiSelectAddSetAll() helper.

* MultiSelect: fixed an issue caused by previous commit.

Amend a285835. Breaks box-select.

* MultiSelect: BoxSelect: fixed box-select from void setting nav id multiple times.

* Internals: comment out obsolete g.ActiveIdUsingNavInputMask obsoleted two years ago. (#4921, #4858, #787, #1599, #323)

Use SetKeyOwner(ImGuiKey_Escape, g.ActiveId); instead. Amend 8b8a61b

* Obsoleted GetWindowContentRegionMin() and GetWindowContentRegionMax().

You should never need those functions. You can do everything with GetCursorScreenPos() and GetContentRegionAvail().

* Moved everyone's best friend GetContentRegionAvail() to a more prominent position.

* Internals: removed GetContentRegionMaxAbs() which was only meaningfully used in place of GetContentRegionAvail().

* Obsoleted GetContentRegionMax().

* Docs: added extraneous link to Getting Started section.

* Added io.ConfigNavSwapGamepadButtons to swap Activate/Cancel (A<>B) buttons, to match the typical "Nintendo/Japanese consoles" button layout when using Gamepad navigation. (#787, #5723)

* Added GetID(int) variant for consistency. (#7111)

* Misc micro-optimizations related to hot-path of dealing with a large clipped tree.

Halved times by two in MSVC Debug x64.

* Docs: misc update.

* InputText: Added '\' and '/' as word seperator. (#7824, #7704)

Adding those seperators means that ctrl+(left|right)-arrows and ctrl+backspace will stop at slashes, which is more inline with how most software works and generally is very convenient when dealing with paths or urls.

* Selectable: added ImGuiSelectableFlags_Highlight flag to highlight items independently from the hovered state. (#7820)

Demo: Make the Widget/List boxes show how to use forced highlighting.

* Viewports: update fallback monitor to primary monitor if there's one.

Amend 4b9bc49.
+ metrics: display fallback monitor.

* Tables: storing LastFrozenHeight for frozen requests that don't have actual freezing due to zero scrolling. (#7821, #5143)

Amend 0b4a1a40
(ignore whitespace to view this patch easily)

* MultiSelect: BoxSelect: fixed using in frozen table. (#7821, #5143) + added Demo.

Amend 0b4a1a40

* Backends: Vulkan: ImGui_ImplVulkan_SwapBuffers() still proceeds increasing counts on VK_SUBOPTIMAL_KHR. (#7825, #3881)

Amend 085cff2

* Added SetNextItemStorageID() for tree nodes. (#7553, #6990, #3823, #1131)

Undo/amend 7c6d4ff.

* Comments, minor tweaks to ImGuiTextFilter.

* Demo: MultiSelect: added tree demo. (#6990, #3823, #1861)

* Eaxmples: Android: Fix build failed issue. (#7832)

set android:exported to true (IntentFilter)

Signed-off-by: Sunrisepeak <speakshen@163.com>

* Demo: re-use tree data. Fix property editor vertical alignment. Tweak recent memory allocation monitor.

* Clipper: accept that no item have been submitted if in indeterminate Begin(INT_MAX) mode. (#1311, #3823)

* Version 1.91.0

* Version 1.91.WIP

* Examples: SDL2 (all), SDL3 (all), Win32+OpenGL3: Rework examples main loop to handle minimization without burning CPU or GPU by running unthrottled code. (#7844)

* Examples: GLFW: rework examples main loop to handle minimization without burning CPU or GPU by running unthrottled code. (#7844)

Backends: GLFW: added ImGui_ImplGlfw_Sleep() helper.

* Examples: Fix for Emscripten. GLFW+WGPU: rework examples main loop to handle minimization. (#7844)

Amend 8874787, 71ee2ce
Amend ea39841 (emscripten_mainloop_stub.h)

* Examples: SDL3: Update readme to use SDL3_DIR (#7846)

* MultiSelect, TreeNode, Drag and Drop: fixed an issue where carrying a drag and drop payload over an already open tree node would select it. (#7850)

* MultiSelect+TreeNode: default open behavior is OpenOnDoubleClick + OpenOnArrow when used in a multi-select context without any OpenOnXXX flags set. (#7850)

* Viewports: rework viewport's WorkOffset (positive top-left, negative top-right0 into WorkInset (positive everywhere). (#7823)

* Viewports: added platform_io.Platform_GetWindowWorkAreaInsets() hook. (#7823)

* Window refresh policy: fixed child window of skiprefresh windows not displaying. (#7797)

Amend d449544. (#3515, #4763, #7556, #5116 , #4076, #2749, #2268)

* Window refresh policy: extend tests to any window in the begin stack. (#7797)

* Fonts: amend assert when glyph range data seems incorrect. (#7856)

* CI: Build example_sdl2_sdlrenderer2 with msbuild (#7864)

* Demo: Fixed truncation warning. (#7857)

* Viewports: don't call platform_io.Platform_GetWindowWorkAreaInsets() before window creation. (#7823)

Amend a18f020

* Examples: SDL2+SDLRenderer: fixed return value. (#7876)

* TextLink(), TextLinkOpenURL(): change mouse cursor to Hand shape when hovered. (#7885, #7660)

* Backends: GLFW: don't submit monitor with 0 DpiScale (e.g. accessibility virtual monitor?). to prevent assert. (#7902)

* Backends: SDL2, SDL3: Replace Win32 hack with SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN hint. (#7896)

* Backends: SDL2, SDL3, Win32: don't submit monitor with 0 DpiScale (e.g. accessibility virtual monitor?). to prevent assert. (#7902)

I am not too confident on this but I believe pushing this is the fastest way we will get feedback.

* Backends: SDL2, SDL3: ignore events of other SDL windows. (#7853)

* Backends: SDL2, SDL3: ignore events of other SDL windows, amends + wrapping into a function as it'll be convenient for multi-viewport check. (#7853)

+ Misc typo fix.

* Backends: SDL2, SDL3: storing SDL_WindowID inside ImGuiViewport::PlatformHandle instead of SDL_Window*. (#7853)

This will be used to support filtering of events with multi-viewports.

* Backends: SDL2, SDL3: amend filtering logic for it to work with multi-viewports. (#7853)

* Docs: better promote IMGUI_DEFINE_MATH_OPERATORS. (#6164, #6137, #5966, #2832)

* Internals: renamed IsModKey() -> IsLRModKey() and GetModForModKey() -> GetModForLRModKey() to be more explicit.

* IO: rework interleaved keys<>char trickling: only trickle for keys known to be likely to input characters. (#7889, #4921, #4858)

Amend fa2b318. Refer to regression test "inputs_io_inputqueue" amended for IMGUI_VERSION_NUM >= 19102

* IO, InputText: missing changelog entry (amend 092c88d) + readme note on missing features.

* Fonts: Made it possible to use PushFont()/PopFont() calls accross Begin() calls. (#3224, #3875, #6398, #7903)

* Windows: adjust default ClipRect to better match rendering of thick borders. (#7887, #7888 + #3312, #7540, #3756, #6170, #6365)

* ImGuiSelectionBasicStorage constructor needs visibility (#7906)

* InputText: allow callback to update buffer while in read-only mode (fix for imgui_memory_editor 0.54 in read-only mode).

See ocornut/imgui_club#46

* InputText: fixed an issue programmatically refocusing a multi-line input which was just active. (#4761, #7870)

Amend 66f0fb9, c5db276

* Style: added PushStyleVarX(), PushStyleVarY() helpers to modify only one component of a ImVec2 var.

+ tweak existing function to early out on error.

* Backends: GLFW: passing null window to glfwGetClipboardString()/glfwSetClipboardString().

* IO: Added GetPlatformIO(), ImGuiPlatformIO, currently empty.

* IO: (BREAKING) moved GetIO().PlatformOpenInShellFn to GetPlatformIO(.Platform_OpenInShellFn. (#7660)

* IO: (BREAKING) moved GetIO().PlatformSetImeDataFn to GetPlatformIO(.Platform_SetImeDataFn. (#7660)

* IO: (BREAKING) moved io.PlatformLocaleDecimalPoint to platform_io.Platform_LocaleDecimalPoint. (#7389, #6719, #2278)

* IO: (BREAKING) moved io.GetClipboardTextFn, io.SetClipboardTextFn to platform_io.Platform_GetClipboardTextFn, platform_io.Platform_SetClipboardTextFn.

* (BREAKING) Commented out obsolete ImageButton(). (#5533, #4471, #2464, #1390)

* Backends: GLFW: undo accidentally not committing use of Platform_SetClipboardTextFn as I was testing the legacy path (amend 214977e).

* Backends: GLFW: undo accidentally not committing use of Platform_SetClipboardTextFn as I was testing the legacy path (amend 214977e).

* InputText: Internals: store Scroll.y as it seems sane to (internally) expose it in a way that's agnostic of our use of a child window (#7913, #383)

* CI: Add manual trigger for 'workflow_run' builds (#7865)

* InputText: amend d474ed7 for static analysis. (#7913)

* Examples: Win32+OpenGL3: added batch. file for msys2/mingw build. (#6544)

* Tooltips, Drag and Drop: made it possible to override BeginTooltip() position while inside a drag and drop source or target. (#6973)

* BeginChild: (BREAKING) renamed ImGuiChildFlags_Border to ImGuiChildFlags_Borders.

Amend 7713c29 + renamed similar argument in other functions.

* Fixed Clang17 C++26 warning. (#7383)

Unable to repro locally for now.

* Tables: revert a340718 extending outer bottom/right border by 1, this is not the right solution. (#6765, #3752)

* Tables: another attempt at making contents not overlap the bottom and right border in a scrolling table. (#6765, #3752, #7428)

* Tabs: avoid queuing a refocus when tab is already focused, which would have the side-effect of e.g. closing popup on a mouse release. (#7914)

* Fixed duplicate declaration of GetPlatformIO() in header. (#7917)

* Changed call from cosf to ImCos (#7939)

* Fix minor typo (#7943)

* Update FONTS.md (#7944)

* Tabs: avoid queuing a refocus when tab is already focused, which would have the side-effect of e.g. closing popup on a mouse release. (#7914)

+ Debug Log: add details about closed popups.

* Backends: SDL3: following SDL3 reverting their change, result of SDL_GetGamepads must be freed. (#7918, #7898, #7807)

* Examples: SDL3: Update for API changes: SDL_Init() returns 0 on failure.

* Backends: SDL3: following SDL3 reverting their change, result of SDL_GetDisplays() must be freed. (#7809)

Reverts 271910e

* Demo: added emscripten version. (#7915)

* Backends: GLFW: Emscripten: use OpenURL() when available and using EMSCRIPTEN_USE_PORT_CONTRIB_GLFW3. Fixes popup blocked in some browsers. (#7915, #7660)

* Viewports: fixed misuse of inset_max.y, which typically would have broken using BeginViewportSideBar() with ImGuiDir_Down, regression from 1.91.0. (#7940, #7823)

Amend cfd2395

* Misc merge/small stuff from docking to reduce drift.

Among other things:
- merged cfd2395 (#7940, #7823), also see ac64b65 (#6716): moved above on 2023/08/14 in both branches.
- moving the RenderDimmedBackgrounds() call, from f422e78, see 676497f intently undoing ac64b65 -> confusing. (#6716)

* Made BeginItemTooltip() and IsItemHovered() with delay flag infer an implicit ID using Pos only. (#7945, #1485, #143)

Perhaps a better approach would be to: store last non-zero ID + count successive zero ID and combine then.

* PlotHistogram, PlotLines: register item ID in a more idiomatic manner. (#7935, #3072)

* PlotHistogram, PlotLines: use ButtonBehavior() to be idiomatic. (#7935, #3072)

* Tables: comments. (#7937)

* Tables: fixed an issue detecting hovering column/row when using multiple synched instances layed out at different X positions. (#7933)

Was reading ClipRect from last frame.

* Tables: fixed resizing columns when using multiple synched instances that are layed out at different X positions. (#7933)

TableGetMaxColumnWidth() was using MinX from previous column. Storing info in column. Still incorrect interleaved data for multi-instances but it covers majority of use cases.

* Version 1.91.1

* Fixed C++26 invalid enum operation (#7954)

* CI: upgrade Ubuntu version to get newer Clang. Add C++26 build test. (#7954)

* CI: Amend e3cb016.

* CI: Amend 943fd21.

* CI: build with Clang C++26 on Linux. (#7954)

* Version 1.91.2 WIP

* Nav: pressing any keyboard key while holding Alt disable toggling nav layer on Alt release. (#4439, extend #370, #369)

* InputText: added CJK double-width punctuation to list of separators considered for CTRL+Arrow.

* TextLinkOpenURL: display a verb in front the link. Update Gallery & other links. (#7885, #7660)

* InputText: renamed namespace from stb_texture structure and added an indirection.

* InputText: moved all ImGuiInputTextState functions to not be inline.

* InputText: moved imstb_textedit.h include to imgui_widgets.cpp

* Backends: SDL2: use SDL_Vulkan_GetDrawableSize with Vulkan instead of SDL_GL_GetDrawableSize. (#7967, #3190)

* Demo: fix some id conflicts. (#7961)

* Added io.ConfigDebugHighlightIdConflicts debug feature! (#7961, #7669)

Also #74, #96, #480, #501, #647, #654, #719, #843, #894, #1057, #1173, #1390, #1414, #1556, #1768, #2041, #2116, #2330, #2475, #2562, #2667, #2807, #2885, #3102, #3375, #3526, #3964, #4008, #4070, #4158, #4172, #4199, #4375, #4395, #4471, #4548, #4612, #4631, #4657, #4796, #5210, #5303, #5360, #5393, #5533, #5692, #5707, #5729, #5773, #5787, #5884, #6046, #6093, #6186, #6223, #6364, #6387, #6567, #6692, #6724, #6939, #6984, #7246, #7270, #7375, #7421, #7434, #7472, #7581, #7724, #7926, #7937 and probably more.. Tagging to increase visibility!

* InputText: added native support for UTF-8 text editing and god rid of the wchar buffer. (#7925)

WIP (requires subsequent commits for fixes)

* InputText: amends: renames, coding style. (#7925)

* InputText: amends: add stb_textedit_text() api. (#7925)

It seems sensible to push this change in stb_textedit repo eventually.

* InputText: amends: add note about STB_TEXTEDIT_GETCHAR. tweak InputTextCalcTextSize() to use similar debug-friendly logic as ImFont:CalcTextSizeA(). misc small tidying up. (#7925)

* InputText: amends: fixed next/prev word implementation. (#7925)

+ replace IMSTB_TEXTEDIT_GETPREVCHARINDEX code with ImTextFindPreviousUtf8Codepoint().

* InputText: amends: fixed undo-stack reconcile. fixed metrics crash. fixes character filtering. (#7925)

Refer to imgui_test_suite for tests.

* InputText: amends: now can use memchr()/strchr() for line counting. Much faster! (#7925)

* Fonts: fixed ellipsis "..." rendering width miscalculation bug introduced in 1.91.0. (#7976)

Amend 0f63d3e

* Doc: Fix typo. (#7974)

* Backends: SDL3: added support for viewport->ParentViewportId field to support parenting windows at OS level. (#7973)

* Backends: GLFW+Emscripten: use OSX behaviors automatically when using contrib glfw port. (#7965, #7915)

* CI: amend build tests for emscripten (#7965)

+ Backends: GLFW: minor preemptive fix.

* MultiSelect+Tables: fixed an issue where box-select would skip items while drag-scrolling in a table with outer borders. (#7970, #7821).

See "widgets_multiselect_boxselect_2" test.

* Misc: Made it accepted to call SetMouseCursor() with any out-of-bound value, as a way to allow hacking in custom cursors if desirable.

* Viewports: fixed an issue where a window manually constrained to the main viewport while crossing over main viewport bounds isn't translated properly. (#7985)

Amend 967073b

* CI: disable month-long PVS Studio warning about expiring licence.

* Backends: Win32: fixed direct calls to platform_io.Platform_SetWindowPos()/Platform_SetWindowSize() on windows created by application (typically main viewport).

* InputText: optimization for large text: using memchr() instead of strchr() shaves 0.2 ms on 865k multi-line text case. Approximately 20%. (#7925)

* InputText: minor tidying up of selection search loop (no need to imply it runs in single line mode)

* InputText: more tidying up of selection search loop.

* InputText: optimize InputTextCalcTextLenAndLineCount() for inactive multiline path. (#7925)

* Backends: WGPU: add IMGUI_IMPL_WEBGPU_BACKEND_DAWN/IMGUI_IMPL_WEBGPU_BACKEND_WGPU to support more targets. (#7977, #7969, #6602, #6188, #7523)

* Backends: Win32: fixed an issue where a viewport destroyed while clicking would hog mouse tracking and temporary lead to incorrect update of HoveredWindow. (#7971)

* Backends: Win32: fixed an issue where a viewport destroyed while clicking would hog mouse tracking and temporary lead to incorrect update of HoveredWindow. (#7971)

# Conflicts:
#	backends/imgui_impl_win32.cpp
#	docs/CHANGELOG.txt

* AddFont: added assert to better detect uninitialized struct. (#7993)

* Backends: SDL3: rework implementation of ImGuiViewportFlags_NoTaskBarIcon. (#7989)

* Tables: using table->InnerClipRect more consistently. Fixes an assertion with tables with borders when clipped by parent. (#6765, #3752, #7428)

* Tables: fixed assertion related to inconsistent outer clipping when sizes are not rounded. (#7957)

* Windows: fixed an issue where double-click to collapse could be triggered even while another item is active. (#7841, #7369)

* Inputs: SetNextItemShortcut() with ImGuiInputFlags_Tooltip doesn't show tooltip when item is active.

* Tables: fixed auto-width columns when using synced-instances of same table. (#7218)

Amend d3c3514

* InputText: fixed not filling callback's SelectionEnd. (#7925)

Broken by abd07f6

* Backends: make ImGui_ImplSDL2_KeyEventToImGuiKey(), ImGui_ImplSDL3_KeyEventToImGuiKey(), ImGui_ImplGlfw_KeyToImGuiKey(), ImGui_ImplWin32_KeyEventToImGuiKey(), ImGui_ImplAllegro5_KeyCodeToImGuiKey(), ImGui_ImplOSX_KeyCodeToImGuiKey(), non-static. (#7997)

Backends: Win32: Refactor ImGui_ImplWin32_KeyEventToImGuiKey() logic.
Ref #7672

* Backends: ensure that ImGuiPlatformMonitor list is available after backend Init call. (#7995)

* Version 1.91.2

* Version 1.91.3 WIP

* Backends: SDL3: Update for API changes: SDL_bool removal. SDL_INIT_TIMER removal. (#7999)

* Error check: clarified that carriage returns are emitted by our code. Added helper default callback. Comments. (#1651)

(doesn't affect test engine hook for it as trailing \n are trimmed anyhow)

* Error check: fixed build when using IMGUI_DISABLE_DEBUG_TOOLS.

* Scrollbar: Shift+Click always use absolute positionning scroll. (#8002, #7328)

* Scrollbar: added io.ConfigScrollbarScrollByPage setting. (#8002, #7328)

* Backends: WGPU: Fix new WGPUStringView breaks shader compilation. (#8009, #8010)

* Backends: SDL2, SDL3: Fixed building for UWP platforms. (#8008)

* Error Handling: fixed an issue ErrorCheckEndWindowRecover() when aborting in a child inside a tab bar. (#1651)

* TestEngine: log calls don't need testing hook active.

Docs: tweak comments on BeginDisabled(false)/EndDisabled() pairs.

* Refactor: moved ImGuiContext contructor to imgui.cpp

* Internals: misc tweaks to facilitate branch merging.

* Error handling: rework error tooltip logic (will be reused by upcoming feature). (#7961, #7669, #1651)

+ Comments

* Windows: BeginChild(): made it possible to call SetNextWindowSize() on a child window using ImGuiChildFlags_ResizeX/ImGuiChildFlags_ResizeY. (#1710, #8020)

* Internals: NewFrame: move the window reset loop higher up, namely before UpdateHoveredWindowAndCaptureFlags() -> FindHoveredWindowEx().

This allows using FindHoveredWindowEx() from anywhere in the frame.

* Error Handling, Debug Log: added IMGUI_DEBUG_LOG_ERROR() with special handling. (#5855, #1651, #5654)

* Error Handling: rewired asserts in PopID(), PopFont(), PopItemFlag(), EndDisabled(), PopTextWrapPos(), PopFocusScope(), PopItemWidth() to use IM_ASSERT_USER_ERROR().  (#1651, #5654)

* Error Handling: replaced log callback in recovery functions with calls to IM_ASSERT_USER_ERROR(). (#1651, #5654)

This commit is not meant to be functional as-is (it will break test engine recovery). This is mostly to reduce/remove noise from upcoming commits.

* Error Handling: enabled experimental recovery systems. (#1651, #5654)

Setup a couple of features to configure them, including ways to display error tooltips instead of assserting.

* Error Handling: fixed not rewinding to recorded tree and id stack size (#1651)

* Comments. Fixed warnings.

* Comments. Fixed warnings.

* Silence PVS Studio static analyzer false positives.

* Comments (#1651)

* TabBar: added TabBarQueueFocus() by name for non-docking tab bars. (#8029, #6681)

* TabBar: added TabBarQueueFocus() by name for non-docking tab bars. (#8029, #6681)

Amend 655fcf8

* Tooltips, Drag and Drop: Fixed an issue where the fallback drag and drop payload tooltip appeared during drag and drop release.

E.g. it would otherwise appear when releasing a color button payload.

* Tooltips, Drag and Drop: Stabilized name of drag and drop tooltip window. (#8036)

* Tooltips: Tooltips triggered from touch inputs are positionned above the item. (#8036)

* Backends: SDL3: fixes use of now removed SDL_bool.

* Backends: Win32: Use ResisterClassW()/CreateWindowExW() for secondary viewports.  (#7979, #5725)

* Drags, Slider: added ImGuiSliderFlags_ClampOnInput, ImGuiSliderFlags_ClampZeroRange. (#7968, #3361, #76)

* Docs: amend docs to explain case of using multiple overlayed ButtonBehavior(). (#8030, #7961, #7669)

* Fixed static analyser warning. Amend b3c8747

* Version 1.91.3

* Version 1.91.4 WIP

* Backends: misc renaming of locals. Use 'draw_list' instead of 'cmd_list'. Avoid using 'ctx'.

This is likely to trigger merging issues. If it does, best to always get "theirs" and rename in there.

* Backends: DX11, DX12, Vulkan, WGPU: Expose some backend-specific render state usable for callbacks. (#6969, #5834, #7468, #3590)

* Backends: Vulkan: fixed warnings when building in 32-bit mode.

* Backends: DX9, DX10, DX11, DX12, OpenGL, Vulkan, WGPU: Changed default texture sampler to Clamp instead of Repeat/Wrap. (#7468, #7511, #5999, #5502)

* Backends: changed all backends to allow enabling ImGuiConfigFlags_ViewportsEnable after initialization. (#5371)

* cmake

* Update README.md (#2)

* added SDL link in cmake (#1)

* more organized cmake (#3)

* Updating (#4)

* Adding glfw and system handling (#5)

* added the setting of glfw and handle systems without input

* off

* ops

* little thang

* duplicated case values

* again

---------

Signed-off-by: Sunrisepeak <speakshen@163.com>
Co-authored-by: ocornut <omarcornut@gmail.com>
Co-authored-by: Thomas Stehle <th.stehle@icloud.com>
Co-authored-by: Cyao <94928179+cheyao@users.noreply.github.com>
Co-authored-by: chenqiudu <chenqiudu@kuaishou.com>
Co-authored-by: Laurent Dufresne <laurent.dufresne@hotmail.com>
Co-authored-by: Rémi Hérilier <rherilier@yahoo.fr>
Co-authored-by: SPeak <speakshen@163.com>
Co-authored-by: Mark Jansen <mark.jansen@reactos.org>
Co-authored-by: lunarlattice <18731514+lunarlattice0@users.noreply.github.com>
Co-authored-by: Nicolas Noble <nicolasnoble@users.noreply.github.com>
Co-authored-by: RT2 <contact@rt2.fr>
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
Co-authored-by: Pavel Rojtberg <rojtberg@gmail.com>
Co-authored-by: BillKek <51540758+BillKek@users.noreply.github.com>
Co-authored-by: tanoxyz <36295026+tanoxyz@users.noreply.github.com>
Co-authored-by: James Wrigley <JamesWrigley@users.noreply.github.com>
Co-authored-by: omar <ocornut@users.noreply.github.com>
Co-authored-by: Matt Guerrette <direct3Dtutorials@gmail.com>
Co-authored-by: Yan Pujante <yan@pongasoft.com>
Co-authored-by: CrackedMatter <81803926+CrackedMatter@users.noreply.github.com>
Co-authored-by: scribam <scribam@users.noreply.github.com>
Co-authored-by: Pascal Thomet <pthomet@gmail.com>
Co-authored-by: alektron <alektron1@gmail.com>
Co-authored-by: David Briscoe <43559+idbrii@users.noreply.github.com>
Co-authored-by: Aaron C Gaudette <acg@aaronsee.media>
Co-authored-by: Mark Sibly <marksibly@gmail.com>
  • Loading branch information
1 parent d3ae18b commit 1d7340a
Show file tree
Hide file tree
Showing 75 changed files with 3,957 additions and 2,121 deletions.
68 changes: 64 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
# "scheduled" workflow, while maintaining ability to perform local CI builds.
workflows:
- scheduled
- manual
branches:
- master
- docking
Expand Down Expand Up @@ -123,6 +124,11 @@ jobs:
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj /p:Platform=Win32 /p:Configuration=Release'
if: github.event_name == 'workflow_run'

- name: Build Win32 example_sdl2_sdlrenderer2
shell: cmd
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_sdlrenderer2/example_sdl2_sdlrenderer2.vcxproj /p:Platform=Win32 /p:Configuration=Release'
if: github.event_name == 'workflow_run'

- name: Build Win32 example_sdl2_vulkan
shell: cmd
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_vulkan/example_sdl2_vulkan.vcxproj /p:Platform=Win32 /p:Configuration=Release'
Expand Down Expand Up @@ -168,6 +174,11 @@ jobs:
shell: cmd
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_glfw_vulkan/example_glfw_vulkan.vcxproj /p:Platform=x64 /p:Configuration=Release'

- name: Build x64 example_sdl2_sdlrenderer2
shell: cmd
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_sdlrenderer2/example_sdl2_sdlrenderer2.vcxproj /p:Platform=x64 /p:Configuration=Release'
if: github.event_name == 'workflow_run'

- name: Build x64 example_sdl2_vulkan
shell: cmd
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_sdl2_vulkan/example_sdl2_vulkan.vcxproj /p:Platform=x64 /p:Configuration=Release'
Expand Down Expand Up @@ -207,7 +218,7 @@ jobs:
run: '"%MSBUILD_PATH%\MSBuild.exe" examples/example_win32_directx12/example_win32_directx12.vcxproj /p:Platform=x64 /p:Configuration=Release'

Linux:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -313,6 +324,18 @@ jobs:
EOF
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
- name: Build example_null (with C++20)
run: |
cat > example_single_file.cpp <<'EOF'
#define IMGUI_DISABLE_OBSOLETE_KEYIO
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
g++ -I. -std=c++20 -Wall -Wformat -o example_single_file example_single_file.cpp
- name: Build example_null (with IMGUI_DISABLE_DEMO_WINDOWS and IMGUI_DISABLE_DEBUG_TOOLS)
run: |
cat > example_single_file.cpp <<'EOF'
Expand Down Expand Up @@ -370,6 +393,18 @@ jobs:
EOF
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
- name: Build example_null (C++26, Clang)
run: |
cat > example_single_file.cpp <<'EOF'
#define IMGUI_IMPLEMENTATION
#define IMGUI_DISABLE_DEMO_WINDOWS
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
clang++ -I. -std=c++26 -Wall -Wformat -fno-exceptions -fno-threadsafe-statics -lc -lm -o example_single_file example_single_file.cpp
- name: Build example_null (without c++ runtime, Clang)
run: |
cat > example_single_file.cpp <<'EOF'
Expand Down Expand Up @@ -422,6 +457,17 @@ jobs:
EOF
clang++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
- name: Build example_null (single file build, c++20)
run: |
cat > example_single_file.cpp <<'EOF'
#define IMGUI_IMPLEMENTATION
#include "misc/single_file/imgui_single_file.h"
#include "examples/example_null/main.cpp"
EOF
clang++ -I. -std=c++20 -Wall -Wformat -o example_single_file example_single_file.cpp
- name: Build example_null (without c++ runtime)
run: |
cat > example_single_file.cpp <<'EOF'
Expand Down Expand Up @@ -470,7 +516,7 @@ jobs:
xcodebuild -project examples/example_apple_metal/example_apple_metal.xcodeproj -target example_apple_metal_ios CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
Emscripten:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

Expand All @@ -481,6 +527,7 @@ jobs:
emsdk-master/emsdk update
emsdk-master/emsdk install latest
emsdk-master/emsdk activate latest
sudo apt-get install build-essential
- name: Build example_sdl2_opengl3 with Emscripten
run: |
Expand All @@ -489,15 +536,28 @@ jobs:
popd
make -C examples/example_sdl2_opengl3 -f Makefile.emscripten
- name: Build example_glfw_wgpu
# This build compiles example_glfw_wgpu using Makefile.emscripten and Emscripten GLFW built-in implementation (-sUSE_GLFW=3)
# This ensures 2 things: the make build works, and the GLFW built-in implementation is tested
- name: Build example_glfw_wgpu with Emscripten/Makefile
run: |
pushd emsdk-master
source ./emsdk_env.sh
popd
make -C examples/example_glfw_wgpu -f Makefile.emscripten
# This build compiles example_glfw_wgpu using CMakeLists.txt and Emscripten GLFW contrib port (--use-port=contrib.glfw3)
# This ensures 2 things: the CMake build works, and the GLFW contrib port is tested
- name: Build example_glfw_wgpu with Emscripten/CMake
run: |
pushd emsdk-master
source ./emsdk_env.sh
popd
emcc -v
emcmake cmake -B build -DCMAKE_BUILD_TYPE=Release examples/example_glfw_wgpu
cmake --build build
Android:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# This is a dummy workflow used to trigger full builds manually.
#
name: manual

on: workflow_dispatch

jobs:
manual:
runs-on: ubuntu-latest
steps:
- run: exit 0
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ jobs:
fi
cd examples/example_null
pvs-studio-analyzer trace -- make WITH_EXTRA_WARNINGS=1
pvs-studio-analyzer analyze -e ../../imstb_rectpack.h -e ../../imstb_textedit.h -e ../../imstb_truetype.h -l ../../pvs-studio.lic -o pvs-studio.log
pvs-studio-analyzer analyze --disableLicenseExpirationCheck -e ../../imstb_rectpack.h -e ../../imstb_textedit.h -e ../../imstb_truetype.h -l ../../pvs-studio.lic -o pvs-studio.log
plog-converter -a 'GA:1,2;OP:1' -d V1071 -t errorfile -w pvs-studio.log
44 changes: 24 additions & 20 deletions backends/imgui_impl_allegro5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2024-08-22: moved some OS/backend related function pointers from ImGuiIO to ImGuiPlatformIO:
// - io.GetClipboardTextFn -> platform_io.Platform_GetClipboardTextFn
// - io.SetClipboardTextFn -> platform_io.Platform_SetClipboardTextFn
// 2022-11-30: Renderer: Restoring using al_draw_indexed_prim() when Allegro version is >= 5.2.5.
// 2022-10-11: Using 'nullptr' instead of 'NULL' as per our switch to C++11.
// 2022-09-26: Inputs: Renamed ImGuiKey_ModXXX introduced in 1.87 to ImGuiMod_XXX (old names still supported).
Expand Down Expand Up @@ -147,14 +150,14 @@ void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data)
// Render command lists
for (int n = 0; n < draw_data->CmdListsCount; n++)
{
const ImDrawList* cmd_list = draw_data->CmdLists[n];
const ImDrawList* draw_list = draw_data->CmdLists[n];

ImVector<ImDrawVertAllegro>& vertices = bd->BufVertices;
#if ALLEGRO_HAS_DRAW_INDEXED_PRIM
vertices.resize(cmd_list->VtxBuffer.Size);
for (int i = 0; i < cmd_list->VtxBuffer.Size; i++)
vertices.resize(draw_list->VtxBuffer.Size);
for (int i = 0; i < draw_list->VtxBuffer.Size; i++)
{
const ImDrawVert* src_v = &cmd_list->VtxBuffer[i];
const ImDrawVert* src_v = &draw_list->VtxBuffer[i];
ImDrawVertAllegro* dst_v = &vertices[i];
DRAW_VERT_IMGUI_TO_ALLEGRO(dst_v, src_v);
}
Expand All @@ -164,39 +167,39 @@ void ImGui_ImplAllegro5_RenderDrawData(ImDrawData* draw_data)
// FIXME-OPT: Allegro doesn't support 16-bit indices.
// You can '#define ImDrawIdx int' in imconfig.h to request Dear ImGui to output 32-bit indices.
// Otherwise, we convert them from 16-bit to 32-bit at runtime here, which works perfectly but is a little wasteful.
bd->BufIndices.resize(cmd_list->IdxBuffer.Size);
for (int i = 0; i < cmd_list->IdxBuffer.Size; ++i)
bd->BufIndices[i] = (int)cmd_list->IdxBuffer.Data[i];
bd->BufIndices.resize(draw_list->IdxBuffer.Size);
for (int i = 0; i < draw_list->IdxBuffer.Size; ++i)
bd->BufIndices[i] = (int)draw_list->IdxBuffer.Data[i];
indices = bd->BufIndices.Data;
}
else if (sizeof(ImDrawIdx) == 4)
{
indices = (const int*)cmd_list->IdxBuffer.Data;
indices = (const int*)draw_list->IdxBuffer.Data;
}
#else
// Allegro's implementation of al_draw_indexed_prim() for DX9 was broken until 5.2.5. Unindex buffers ourselves while converting vertex format.
vertices.resize(cmd_list->IdxBuffer.Size);
for (int i = 0; i < cmd_list->IdxBuffer.Size; i++)
vertices.resize(draw_list->IdxBuffer.Size);
for (int i = 0; i < draw_list->IdxBuffer.Size; i++)
{
const ImDrawVert* src_v = &cmd_list->VtxBuffer[cmd_list->IdxBuffer[i]];
const ImDrawVert* src_v = &draw_list->VtxBuffer[draw_list->IdxBuffer[i]];
ImDrawVertAllegro* dst_v = &vertices[i];
DRAW_VERT_IMGUI_TO_ALLEGRO(dst_v, src_v);
}
#endif

// Render command lists
ImVec2 clip_off = draw_data->DisplayPos;
for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
for (int cmd_i = 0; cmd_i < draw_list->CmdBuffer.Size; cmd_i++)
{
const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i];
const ImDrawCmd* pcmd = &draw_list->CmdBuffer[cmd_i];
if (pcmd->UserCallback)
{
// User callback, registered via ImDrawList::AddCallback()
// (ImDrawCallback_ResetRenderState is a special callback value used by the user to request the renderer to reset render state.)
if (pcmd->UserCallback == ImDrawCallback_ResetRenderState)
ImGui_ImplAllegro5_SetupRenderState(draw_data);
else
pcmd->UserCallback(cmd_list, pcmd);
pcmd->UserCallback(draw_list, pcmd);
}
else
{
Expand Down Expand Up @@ -292,7 +295,7 @@ void ImGui_ImplAllegro5_InvalidateDeviceObjects()
}

#if ALLEGRO_HAS_CLIPBOARD
static const char* ImGui_ImplAllegro5_GetClipboardText(void*)
static const char* ImGui_ImplAllegro5_GetClipboardText(ImGuiContext*)
{
ImGui_ImplAllegro5_Data* bd = ImGui_ImplAllegro5_GetBackendData();
if (bd->ClipboardTextData)
Expand All @@ -301,14 +304,15 @@ static const char* ImGui_ImplAllegro5_GetClipboardText(void*)
return bd->ClipboardTextData;
}

static void ImGui_ImplAllegro5_SetClipboardText(void*, const char* text)
static void ImGui_ImplAllegro5_SetClipboardText(ImGuiContext*, const char* text)
{
ImGui_ImplAllegro5_Data* bd = ImGui_ImplAllegro5_GetBackendData();
al_set_clipboard_text(bd->Display, text);
}
#endif

static ImGuiKey ImGui_ImplAllegro5_KeyCodeToImGuiKey(int key_code)
// Not static to allow third-party code to use that if they want to (but undocumented)
ImGuiKey ImGui_ImplAllegro5_KeyCodeToImGuiKey(int key_code)
{
switch (key_code)
{
Expand Down Expand Up @@ -448,9 +452,9 @@ bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display)
bd->VertexDecl = al_create_vertex_decl(elems, sizeof(ImDrawVertAllegro));

#if ALLEGRO_HAS_CLIPBOARD
io.SetClipboardTextFn = ImGui_ImplAllegro5_SetClipboardText;
io.GetClipboardTextFn = ImGui_ImplAllegro5_GetClipboardText;
io.ClipboardUserData = nullptr;
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO();
platform_io.Platform_SetClipboardTextFn = ImGui_ImplAllegro5_SetClipboardText;
platform_io.Platform_GetClipboardTextFn = ImGui_ImplAllegro5_GetClipboardText;
#endif

return true;
Expand Down
1 change: 1 addition & 0 deletions backends/imgui_impl_allegro5.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
struct ALLEGRO_DISPLAY;
union ALLEGRO_EVENT;

// Follow "Getting Started" link and check examples/ folder to learn about using backends!
IMGUI_IMPL_API bool ImGui_ImplAllegro5_Init(ALLEGRO_DISPLAY* display);
IMGUI_IMPL_API void ImGui_ImplAllegro5_Shutdown();
IMGUI_IMPL_API void ImGui_ImplAllegro5_NewFrame();
Expand Down
1 change: 1 addition & 0 deletions backends/imgui_impl_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
struct ANativeWindow;
struct AInputEvent;

// Follow "Getting Started" link and check examples/ folder to learn about using backends!
IMGUI_IMPL_API bool ImGui_ImplAndroid_Init(ANativeWindow* window);
IMGUI_IMPL_API int32_t ImGui_ImplAndroid_HandleInputEvent(const AInputEvent* input_event);
IMGUI_IMPL_API void ImGui_ImplAndroid_Shutdown();
Expand Down
Loading

0 comments on commit 1d7340a

Please sign in to comment.