From 16c6734bcbbd793f6b88eb219aa6692d2821f3cf Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 16 Jul 2018 23:39:14 +0200 Subject: [PATCH] Viewport: Revert part of 7abf72e, the viewport ownership stealing is problematic. (#1542). Will rework in the context of docking. (+1 squashed commits) + Fixed unused prototype warning (left-over from a merge) --- imgui.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 9da860d4..86c694c8 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -878,7 +878,6 @@ static void CheckStacksSize(ImGuiWindow* window, bool write); static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window, bool snap_on_edges); static void AddDrawListToDrawData(ImVector* out_list, ImDrawList* draw_list); -static void AddWindowToDrawData(ImVector* out_list, ImGuiWindow* window); static void AddWindowToSortedBuffer(ImVector* out_sorted_windows, ImGuiWindow* window); static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags flags, ImGuiTextEditCallback callback, void* user_data); @@ -5117,12 +5116,16 @@ void ImGui::SetCurrentViewport(ImGuiWindow* current_window, ImGuiViewportP* view if (viewport) { // First window submitted gets viewport ownership + // [2018-07-18] This is problematic: e.g. a drag and drop tooltip may steal viewport of the window it is hovered. Disabling, will rework in Docking branch. + (void)current_window; + /* if (viewport->LastFrameActive < g.FrameCount && viewport->Window != current_window && viewport->Window != NULL && current_window != NULL) { //printf("[%05d] Window '%s' steal Viewport %08X from Window '%s'\n", g.FrameCount, current_window->Name, viewport->ID, viewport->Window->Name); viewport->Window = current_window; viewport->ID = current_window->ID; } + */ viewport->LastFrameActive = g.FrameCount; } if (g.CurrentViewport == viewport)