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

Loosing tooltip when using ImGuiDragDropFlags_SourceExtern #3741

Closed
dgregorius opened this issue Jan 22, 2021 · 1 comment
Closed

Loosing tooltip when using ImGuiDragDropFlags_SourceExtern #3741

dgregorius opened this issue Jan 22, 2021 · 1 comment
Labels

Comments

@dgregorius
Copy link

Version/Branch of Dear ImGui:

Version: 1.79
Branch: docking

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_opengl3.cpp + imgui_impl_glfw.cpp
Compiler: VS 2019
Operating System: Windows 10

My Issue/Question:

I am loosing the tooltip when using ImGuiDragDropFlags_SourceExtern. Instead of the provided tooltip I only get the mystical "...". Besides this everything works like expected.

if ( ImGui::IsItemClicked( ) )
		{
		if ( ImGui::BeginDragDropSource( ImGuiDragDropFlags_SourceExtern ) )
			{
			ImGui::SetDragDropPayload( Z_TREE_NODE_PAYLOAD, &Transform, sizeof( ZTransform* ) );
			ImGui::Text( "Transform" );
			ImGui::EndDragDropSource();
			}
		}
@ocornut ocornut added the drag drop drag and drop label Jan 23, 2021
@ocornut
Copy link
Owner

ocornut commented Jan 26, 2021

Hello,

The tooltip needs to be submitted, here it isn't since you only submit it on the click.
From there I think the issue is similar as described in second part of #1725 so I'll move the conversation there.

If you look at this specific comment: #1725 (comment)

  • Item (1) was implemented (payload is kept even if source stops being submitted).
  • Item (2) wasn't implemented but should be possible to do at the user level. Essentially we should provide an idiomatic way to encourage people to submit description tooltip not at the source but somewhere in the main-loop. User code can peak at the payload data and generate the tooltip for it. This would fix the more general problem described by Losing drag and drop when clipped or source item becomes not visible / or not submitted anymore #1725.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants