From 27f420c8eabb908d1532f1b7350f1a7856e7a913 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 13 Nov 2023 00:06:04 +0100 Subject: [PATCH] fix: Main Window being moved when window overlapping titlebar is moved --- main/gui/source/window/win_window.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main/gui/source/window/win_window.cpp b/main/gui/source/window/win_window.cpp index d4309cad4..ebe7fd680 100644 --- a/main/gui/source/window/win_window.cpp +++ b/main/gui/source/window/win_window.cpp @@ -194,6 +194,8 @@ namespace hex { break; } + std::string_view hoveredWindowName = GImGui->HoveredWindow == nullptr ? "" : GImGui->HoveredWindow->Name; + switch (result) { case RegionLeft: return HTLEFT; @@ -213,9 +215,10 @@ namespace hex { return HTBOTTOMRIGHT; case RegionClient: default: - if ((cursor.y < (window.top + g_titleBarHeight * 2)) && !(ImGui::IsAnyItemHovered() || ImGui::IsPopupOpen(nullptr, ImGuiPopupFlags_AnyPopupId))) + if ((cursor.y < (window.top + g_titleBarHeight * 2)) && !ImGui::IsAnyItemHovered() && (hoveredWindowName == "##MainMenuBar" || hoveredWindowName == "ImHexDockSpace")) return HTCAPTION; - else break; + else + break; } break; }