Inputs: fix moving a window or drag and dropping from capture mods. (#5888, #4921, #456)

Amend change of SetActiveIdUsingAllKeyboardKeys() in 4448d97 which seemingly accidentally reverted the change intended by fd408c97
This commit is contained in:
ocornut
2022-11-16 17:40:44 +01:00
parent 83cee9e091
commit d60985df7f
3 changed files with 12 additions and 5 deletions

View File

@ -1,4 +1,4 @@
// dear imgui, v1.89
// dear imgui, v1.90 WIP
// (main code and documentation)
// Help:
@ -8538,7 +8538,7 @@ ImGuiID ImGui::GetKeyOwner(ImGuiKey key)
ImGuiID owner_id = owner_data->OwnerCurr;
if (g.ActiveIdUsingAllKeyboardKeys && owner_id != g.ActiveId)
if ((key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END) || key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super)
if (key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END)
return ImGuiKeyOwner_None;
return owner_id;
@ -8555,7 +8555,7 @@ bool ImGui::TestKeyOwner(ImGuiKey key, ImGuiID owner_id)
ImGuiContext& g = *GImGui;
if (g.ActiveIdUsingAllKeyboardKeys && owner_id != g.ActiveId)
if ((key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END) || key == ImGuiMod_Ctrl || key == ImGuiMod_Shift || key == ImGuiMod_Alt || key == ImGuiMod_Super)
if (key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END)
return false;
ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key);