diff --git a/examples/vulkan_example/main.cpp b/examples/vulkan_example/main.cpp index 872b1c39..115227f7 100644 --- a/examples/vulkan_example/main.cpp +++ b/examples/vulkan_example/main.cpp @@ -392,7 +392,6 @@ int main(int, char**) VkCommandPool command_pool = wd->Frames[wd->FrameIndex].CommandPool; VkCommandBuffer command_buffer = wd->Frames[wd->FrameIndex].CommandBuffer; - VkResult err; err = vkResetCommandPool(g_Device, command_pool, 0); check_vk_result(err); VkCommandBufferBeginInfo begin_info = {}; diff --git a/imgui.cpp b/imgui.cpp index bfc85340..810c42f9 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -3252,7 +3252,7 @@ static void ImGui::UpdateMovingWindowDropViewport(ImGuiWindow* window) ImRect mouse_viewport_rect = g.MouseViewport->GetRect(); ImVec2 window_pos_in_mouse_viewport = ConvertOsDesktopPosToViewportPos(ConvertViewportPosToOsDesktopPos(window->Pos, window->Viewport), g.MouseViewport); ImRect window_rect_in_mouse_viewport = ImRect(window_pos_in_mouse_viewport, window_pos_in_mouse_viewport + window->Size); - if (mouse_viewport_rect.Contains(window_rect_in_mouse_viewport)) + if ((g.MouseViewport->Flags & ImGuiViewportFlags_HostOtherWindows) && mouse_viewport_rect.Contains(window_rect_in_mouse_viewport)) { // Drop on an existing viewport ImGuiViewport* old_viewport = window->Viewport; @@ -3388,7 +3388,7 @@ static void ImGui::UpdateViewports() ImVec2 main_viewport_os_desktop_pos = ImVec2(0.0f, 0.0f); if ((g.IO.ConfigFlags & ImGuiConfigFlags_EnableViewports)) main_viewport_os_desktop_pos = g.IO.PlatformInterface.GetWindowPos(main_viewport); - Viewport(IMGUI_VIEWPORT_DEFAULT_ID, ImGuiViewportFlags_MainViewport, main_viewport_os_desktop_pos, g.IO.DisplaySize); + Viewport(IMGUI_VIEWPORT_DEFAULT_ID, ImGuiViewportFlags_MainViewport | ImGuiViewportFlags_HostOtherWindows, main_viewport_os_desktop_pos, g.IO.DisplaySize); if (!(g.IO.ConfigFlags & ImGuiConfigFlags_EnableViewports)) { diff --git a/imgui_internal.h b/imgui_internal.h index 28f2daea..38ded77f 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -517,9 +517,10 @@ struct ImDrawDataBuilder enum ImGuiViewportFlags_ { ImGuiViewportFlags_MainViewport = 1 << 0, - ImGuiViewportFlags_NoDecoration = 1 << 1, // Platform Window: Disable platform title bar, borders, etc. - ImGuiViewportFlags_NoFocusOnAppearing = 1 << 2, // Platform Window: Don't take focus when created. - ImGuiViewportFlags_NoInputs = 1 << 3 // Platform Window: Make mouse pass through so we can drag this window while peaking behind it. + ImGuiViewportFlags_HostOtherWindows = 1 << 1, + ImGuiViewportFlags_NoDecoration = 1 << 2, // Platform Window: Disable platform title bar, borders, etc. + ImGuiViewportFlags_NoFocusOnAppearing = 1 << 3, // Platform Window: Don't take focus when created. + ImGuiViewportFlags_NoInputs = 1 << 4 // Platform Window: Make mouse pass through so we can drag this window while peaking behind it. }; struct ImGuiViewport