ocornut / imgui

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

Viewport: docking drop rectangles appear in wrong location because of wrong extrapolation of OS' HoveredViewport #2360

Closed r-lyeh closed 3 years ago

r-lyeh commented 5 years ago

1.68+docking branch+multi-viewport

  1. create some floating windows.
  2. maximize some non-imgui window so it overlaps all imgui windows.
  3. drag a imgui window across the window and notice the issue: current focused imgui window interacts with blurred imgui windows and renders blue regions with clipping.

image

ocornut commented 5 years ago

Hello, I don't understand the explanation/repro here.

r-lyeh commented 5 years ago

Lol me neither :D

r-lyeh commented 5 years ago

So, just create a few floating tabs around the screen, then maximize a non-imgui windows, then pick a random imgui tab and start dragging it around the non-imgui window. You will see rendering artifacts with obvious clipping because the imgui window you are dragging cares and knows about all the other imgui windows, which are blurred/hidden at the time of dragging.

ocornut commented 5 years ago

Could you make a gif while having Metrics>Internal panel visible? Also mention the backends and platform.

r-lyeh commented 5 years ago

Sure thing. Here you have it. GLFW3 + GL3. Win10.

gif

ocornut commented 5 years ago

OK I understand it now.

Cannot solve this without the back-end providing the io.MouseHoveredViewport info honoring transparent-input windows. GLFW_HOVERED was introduced in GLFW master (aiming for GLFW 3.3) but unfortunately as it stands the full information we need is not available in GLFW. Right now, GLFW_HOVERED will always see the window we are dragging.

I requested support for transparent-inputs window here: https://github.com/glfw/glfw/issues/1236 And it is listed in: https://github.com/ocornut/imgui/wiki/Help-Wanted

Unfortunately without more resource on Linux/Mac front and users/devs support this is not going to make it to GFLW. If you have access and experience with those OS, helping solving those tasks/issues would be of tremendous help. I was hoping by the time GLFW 3.3 is out it would have everything necessary to fully support multi-viewports.

r-lyeh commented 5 years ago

Ah, pity. GLFW issue solving is super slow (nothing wrong with that btw), so I also guess the feature not going to make it for 3.3 (or anytime soon). I'd help if I could, but I only have win experience :s

ocornut commented 3 years ago

FYI this was merged in GLFW in July 2020 (https://github.com/glfw/glfw/issues/1236)

This feature has been added as GLFW_MOUSE_PASSTHROUGH with https://github.com/glfw/glfw/pull/1568 by @rokups and will be included in 3.4.

GLFW 3.4 is not out yet but grabbing from master works, and imgui_impl_glfw already supports it. I'll close this as it is out of our realm now.