From 5956fff7e2959574e4273ca1b5cc540fd0dff0d5 Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 30 Oct 2017 00:10:05 +0100 Subject: [PATCH] Drag and Drop: ImGuiButtonFlags_PressedOnDragDropHold focuses the target window. --- imgui.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/imgui.cpp b/imgui.cpp index 383b012e..6603d3f9 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -5848,7 +5848,10 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool hovered = true; SetHoveredID(id); if (CalcTypematicPressedRepeatAmount(g.HoveredIdTimer + 0.0001f, g.HoveredIdTimer + 0.0001f - g.IO.DeltaTime, 0.01f, 0.70f)) // FIXME: Our formula for CalcTypematicPressedRepeatAmount() is fishy + { pressed = true; + FocusWindow(window); + } } if ((flags & ImGuiButtonFlags_FlattenChilds) && g.HoveredRootWindow == window)