Enable ImGui docking + multi-viewport#791
Open
Sajeeth-Wimalasuriyan wants to merge 22 commits into
Open
Conversation
Sajeeth-Wimalasuriyan
commented
Apr 21, 2026
Contributor
…heir own OS window
- Turn on ImGuiConfigFlags_DockingEnable | ImGuiConfigFlags_ViewportsEnable
after ImGui::CreateContext(), and set ConfigViewportsNoTaskBarIcon so
undocked panels don't spawn taskbar entries
- Add the UpdatePlatformWindows() / RenderPlatformWindowsDefault() pass in
the main render loop (with GL-context backup/restore for the OpenGL
fallback path), and reorder so the main backend present() runs after
the platform-windows pass
- Bump the Vulkan descriptor pool from 100 -> 1024 samplers/sets to give
secondary platform viewports headroom
- Mark "Main Window" NoDocking so Summary can be the only dockable
window for now; drop NoSavedSettings from Summary and seed its
initial pos from GetMainViewport()->WorkPos so it lands inside the
main window even after viewport coords become absolute screen coords
Replace BeginDragDropSource "is-item-being-dragged?" hacks in two resize
bars (track height, sidebar width) with the proper
IsItemActive() && IsMouseDragging() idiom. The old pattern interacted
badly with imgui-docking's internal window-move drag-drop and would
spuriously resize tracks when other windows were being dragged.
Fix the track reorder "is_reordering" check to validate the payload
type. imgui-docking calls BeginDockableDragDropSource() during any
window-move, setting g.DragDropActive=true with a "_IMWINDOW" payload.
The old check only tested GetDragDropPayload() != null, so with
m_reorder_request.track_id defaulting to 0 the first track appeared to
be reordering (rendered as Dummy) every time another window was
dragged. Now we additionally require payload->IsDataType("reorder_request").
Made-with: Cursor
Made-with: Cursor
Collaborator
|
There is a bug where the overlapping window disappears (gets pushed to back) if it is clicked and dragged, and then clicked again. |
Snap secondary viewports to the actual OS window position each frame, then restore the intended drag target before platform window updates. This fixes WM-clamped drag cases on X11/Xwayland where ImGui keeps an off-screen viewport position, causing hover offsets and corner-lock behavior.
… platform helpers files.
Only run hooks on systems running wayland
glfwShowWindow and glfwSetWindowPos each XFlush internally, and the next glfwPollEvents performs a server round-trip, so an explicit XSync() here turned out to be unnecessary in practice -- which lets us avoid linking libX11.
Introduce a command-line option `--drag-repair` to manage a workaround for drag and click-through issues specific to Ubuntu's Wayland compositor. The implementation includes parsing the option and applying the appropriate settings based on user input or environment variables. Update platform helper functions to support this feature, ensuring compatibility across different Linux distributions.
Update the command-line option `--drag-repair` to clarify its functionality and improve user experience. The description now specifies the trade-off of a brief flicker during drag-release and restricts the default setting to 'off'. Additionally, enhance comments in the platform helper files to better explain the underlying bugs and the rationale for user-controlled fixes, ensuring clarity on the conditions under which workarounds are applied.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # src/app/src/main.cpp # src/app/src/rocprofvis_imgui_vulkan.cpp
- Drop the custom rocprofvis_view_set_dpi API and the GLFW content-scale callback path. The view now relies on ImGui's ConfigDpiScaleFonts / ConfigDpiScaleViewports for per-monitor scaling. - main.cpp enables ImGuiConfigFlags_ViewportsEnable and the DPI flags, sets FontScaleMain = 1.0f, and renders platform windows via UpdatePlatformWindows / RenderPlatformWindowsDefault while preserving the GLFW context for OpenGL. - Replace the font dropdown with a clamped 13-18 pt slider. User settings only persist a base font index; FontManager exposes GetMinUserFontSize / GetMaxUserFontSize / GetFontSizeAt / GetDefaultFontSizeIndex / ClampFontSizeIndex. - Fix FontSize indexing bug: ImGui's default font now uses FontSize::kDefault (the user-chosen base) instead of FontType::kDefault, which had been silently mapping to FontSize::kSmall (base - 1). Added static_asserts to keep kSizeOffsets in lockstep with the FontSize enum. - Drop dpi_based_scaling from DisplaySettings and its JSON key; SettingsManager no longer tracks DPI. Co-authored-by: Cursor <cursoragent@cursor.com>
…caling Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Compute the status bar height as the framed content line plus the child border (FramePadding taken from the default style to match RenderStatusBar) instead of a magic formula, and remove the ImGuiWindowFlags_NoScrollbar bandaid. The previous calculation read the live style and ignored the child border, so the bar could overflow into a scrollbar under ImGui auto-DPI font scaling. Co-authored-by: Cursor <cursoragent@cursor.com>
Re-add the GLFW_SCALE_TO_MONITOR hint to both the initial Vulkan window and the OpenGL-fallback window setup. It was dropped during the DPI cleanup but is still needed for correct per-monitor window scaling. Addresses review feedback. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # src/app/src/main.cpp
log drag repair state if used
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # src/app/src/main.cpp # src/view/src/widgets/rocprofvis_gui_helpers.cpp
remove unused functions remove unused headers don't call View namespace objects from main fix summary merge error
Member
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.
