ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
57.74k stars 9.9k forks source link

Docking markers rendered at wrong location when attempting to move viewports outside of monitor boundaries #7664

Open VitalyVint opened 4 weeks ago

VitalyVint commented 4 weeks ago

Hello, i got strange results with docking examples, maybe something wrong with my setup, i am not sure. Maybe someone could advise me where start to dig to fix this... Or maybe i miss stable docking version?

Version/Branch of Dear ImGui:

Branch: docking, last commit fdc084f532189fda8474079f79e74fa5e3541c9f

Back-ends:

imgui_impl_vulkan.cpp + imgui_impl_glfw.cpp

Compiler, OS:

os: linux + X11, compiler: gcc (Gentoo 13.2.1_p20240210 p14) 13.2.1 20240210 vulkan version 1.3.280, vkinfo.txt glfw-3.4

Full config/build information:

build default example (need glfw-3.4 sources) with this CMakeLists.txt

project(test-imgui)

set (imgui imgui-docking)

find_package(Vulkan REQUIRED)
add_subdirectory(glfw-3.4)
add_executable(test-imgui
    ${imgui}/imgui.cpp
    ${imgui}/imgui_demo.cpp
    ${imgui}/imgui_draw.cpp
    ${imgui}/imgui_tables.cpp
    ${imgui}/imgui_widgets.cpp

    ${imgui}/backends/imgui_impl_vulkan.cpp
    ${imgui}/backends/imgui_impl_glfw.cpp 

    ${imgui}/examples/example_glfw_vulkan/main.cpp
)

target_link_libraries(test-imgui glfw Vulcan)
target_include_directories(test-imgui PRIVATE ${imgui} ${imgui}/backends)

Details:

Enable docking, try to move window, docking markers move with window. Sometimes sub windows lost focus and become hidden behind main window.

Screenshots/Video:

video video.mp4

Minimal, Complete and Verifiable Example code:

examples/example_glfw_vulkan/main.cpp from repo used build with cmake --build . --config Debug

ocornut commented 3 weeks ago

This is a by product of original #2117 issue with multi-viewports, they are programmed with the expectation that window manager honor requested position, and don’t handle it well when it doesn’t. In your case, dear imgui thinks the window is being moved down, but the window manager prevents that from happening, and our docking markers are drawn given expected position of the window. Aside from the markers, the inputs would be broken.

I am expecting to fix that now i have access to a MacOS device exhibiting similar issue.