mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
NewFrame: Allow MovedWindow setting the ImGuiWindowFlags_NoInputs after moving has started in order to be able to detect windows below it, which is useful for e.g. docking mechanisms.
This commit is contained in:
@ -2361,8 +2361,11 @@ void ImGui::NewFrame()
|
||||
SaveIniSettingsToDisk(g.IO.IniFilename);
|
||||
}
|
||||
|
||||
// Find the window we are hovering. Child windows can extend beyond the limit of their parent so we need to derive HoveredRootWindow from HoveredWindow
|
||||
g.HoveredWindow = g.MovingWindow ? g.MovingWindow : FindHoveredWindow(g.IO.MousePos);
|
||||
// Find the window we are hovering
|
||||
// - Child windows can extend beyond the limit of their parent so we need to derive HoveredRootWindow from HoveredWindow.
|
||||
// - When moving a window we can skip the search, which also conveniently bypasses the fact that window->WindowRectClipped is lagging as this point.
|
||||
// - We also support the moved window toggling the NoInputs flag after moving has started in order to be able to detect windows below it, which is useful for e.g. docking mechanisms.
|
||||
g.HoveredWindow = (g.MovingWindow && !(g.MovingWindow->Flags & ImGuiWindowFlags_NoInputs)) ? g.MovingWindow : FindHoveredWindow(g.IO.MousePos);
|
||||
g.HoveredRootWindow = g.HoveredWindow ? g.HoveredWindow->RootWindow : NULL;
|
||||
|
||||
if (ImGuiWindow* modal_window = GetFrontMostModalRootWindow())
|
||||
|
Reference in New Issue
Block a user