Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drag and drop problems with multiple platform windows #7922

Closed
azonenberg opened this issue Aug 27, 2024 · 7 comments
Closed

Drag and drop problems with multiple platform windows #7922

azonenberg opened this issue Aug 27, 2024 · 7 comments

Comments

@azonenberg
Copy link
Contributor

Version/Branch of Dear ImGui:

1.91.1 19104 docking

Back-ends:

Vulkan

Compiler, OS:

gcc, Linux X11 (Debian stable)

Full config/build information:

No response

Details:

This might be a couple of bugs or just one, I'm still investigating, but I'm seeing drag-and-drop behave weirdly with multiple platform windows. We can split into separate issues if it turns out to be separate bugs.

Dragging outside a platform window creates spurious drop events

Steps to reproduce:

  1. Create an imgui_demo window
  2. Drag the demo window outside the main application so it spawns a separate platform window and does not overlap the main window (this last part is important)
  3. Open the "tooltip at target location" drag and drop example
  4. Attempt to drag the red box into the main application window
  5. Observe the drag-and-drop ending as soon as the mouse cursor leaves an ImGui window

It appears that "leave all imgui windows" is the trigger for this failing. If the source and destination windows partially overlap (separate platform windows, but cursor is always over an imgui window) drag and drop appears to work as expected.

Tooltips leaving the source platform window create spurious drop events

Steps to reproduce:

  1. Create an imgui demo window
  2. Drag the demo window outside the main application
  3. Open the "tooltip at target location" example
  4. Resize the demo window so that it's tall and skinny (in my example I have "tooltip at target loc" then the window is cropped)
  5. Attempt to drag the red box and observe that as soon as the tooltip spawns, the drag-and-drop ends

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

Unmodified imgui_demo.cpp

@azonenberg
Copy link
Contributor Author

The workaround I'm using in ngscopeclient for the second issue is to suppress the tooltip if the left mouse button is down. I don't currently have a workaround for the first.

@ocornut
Copy link
Owner

ocornut commented Sep 3, 2024

Please specify the platform backend and if SDL or GLFW specify their version.

@azonenberg
Copy link
Contributor Author

GLFW 3.3.8-1 (Debian bookworm) is what I'm testing on. Unsure if this happens on others as well as it's all I have readily available.

@azonenberg
Copy link
Contributor Author

Update: Tested with latest upstream imgui docking as of today (c71e48c7) and the GLFW and SDL2 versions shipped with Debian stable. Both using Vulkan backend.

The issue happens consistently using example_glfw_vulkan but not example_sdl2_vulkan, suggesting that it is specific to the GLFW backend.

@azonenberg
Copy link
Contributor Author

Also happens with example_glfw_opengl3, so not Vulkan specific.

@JamesWrigley
Copy link
Contributor

I think this a duplicate of #3158. Also see: #7733 (comment)

ocornut added a commit that referenced this issue Nov 5, 2024
… while dragging and creating new viewport. (#3158, #7733, #7922)

Initially suggested by rokups. Rewrote for recent backends with a few tweaks to accomodate for variable WM unfocus timing.
@ocornut
Copy link
Owner

ocornut commented Nov 5, 2024

This is now fixed by c347d69. Thanks everyone for the help, and @rokups, and sorry for taking so long to look at this workaround.

@ocornut ocornut closed this as completed Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants