mirror of
https://github.com/Drezil/imgui.git
synced 2025-03-31 16:32:45 +00:00
Fixed incorrect assert triggering when code steal ActiveID move user moving window by calling e.g. SetKeyboardFocusHere()
This commit is contained in:
parent
827ff970cd
commit
8094aa78d2
@ -1288,7 +1288,7 @@ struct ImGuiState
|
|||||||
bool ActiveIdIsJustActivated; // Set at the time of activation for one frame
|
bool ActiveIdIsJustActivated; // Set at the time of activation for one frame
|
||||||
bool ActiveIdIsFocusedOnly; // Set only by active widget. Denote focus but no active interaction
|
bool ActiveIdIsFocusedOnly; // Set only by active widget. Denote focus but no active interaction
|
||||||
ImGuiWindow* ActiveIdWindow;
|
ImGuiWindow* ActiveIdWindow;
|
||||||
ImGuiWindow* MovedWindow; // Track the child window we clicked on to move a window. Only valid if ActiveID is the "#MOVE" identifier of a window.
|
ImGuiWindow* MovedWindow; // Track the child window we clicked on to move a window. Pointer is only valid if ActiveID is the "#MOVE" identifier of a window.
|
||||||
float SettingsDirtyTimer;
|
float SettingsDirtyTimer;
|
||||||
ImVector<ImGuiIniData> Settings;
|
ImVector<ImGuiIniData> Settings;
|
||||||
int DisableHideTextAfterDoubleHash;
|
int DisableHideTextAfterDoubleHash;
|
||||||
@ -2399,13 +2399,14 @@ void ImGui::Render()
|
|||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|
||||||
// Click to focus window and start moving (after we're done with all our widgets)
|
// Click to focus window and start moving (after we're done with all our widgets)
|
||||||
|
if (!g.ActiveId)
|
||||||
|
g.MovedWindow = NULL;
|
||||||
if (g.ActiveId == 0 && g.HoveredId == 0 && g.IO.MouseClicked[0])
|
if (g.ActiveId == 0 && g.HoveredId == 0 && g.IO.MouseClicked[0])
|
||||||
{
|
{
|
||||||
if (!(g.FocusedWindow && !g.FocusedWindow->WasActive && g.FocusedWindow->Active)) // Unless we just made a popup appear
|
if (!(g.FocusedWindow && !g.FocusedWindow->WasActive && g.FocusedWindow->Active)) // Unless we just made a popup appear
|
||||||
{
|
{
|
||||||
if (g.HoveredRootWindow != NULL)
|
if (g.HoveredRootWindow != NULL)
|
||||||
{
|
{
|
||||||
IM_ASSERT(g.MovedWindow == NULL);
|
|
||||||
g.MovedWindow = g.HoveredWindow;
|
g.MovedWindow = g.HoveredWindow;
|
||||||
SetActiveId(g.HoveredRootWindow->MoveID, g.HoveredRootWindow);
|
SetActiveId(g.HoveredRootWindow->MoveID, g.HoveredRootWindow);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user