1
0
mirror of synced 2025-01-29 19:17:28 +01:00

fix: Main Window being moved when window overlapping titlebar is moved

This commit is contained in:
WerWolv 2023-11-13 00:06:04 +01:00
parent 29dd3d5fc3
commit 27f420c8ea

View File

@ -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;
}