1
0
mirror of synced 2025-02-06 14:14:22 +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; break;
} }
std::string_view hoveredWindowName = GImGui->HoveredWindow == nullptr ? "" : GImGui->HoveredWindow->Name;
switch (result) { switch (result) {
case RegionLeft: case RegionLeft:
return HTLEFT; return HTLEFT;
@ -213,9 +215,10 @@ namespace hex {
return HTBOTTOMRIGHT; return HTBOTTOMRIGHT;
case RegionClient: case RegionClient:
default: 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; return HTCAPTION;
else break; else
break;
} }
break; break;
} }