[client] imgui: fix modifier key modification race

imgui really hates it when we update the modifier key state after igNewFrame.
The result is:

    void ImGui::ErrorCheckEndFrameSanityChecks(): Assertion
    `(key_mod_flags == 0 || g.IO.KeyMods == key_mod_flags) &&
    "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods"'
    failed.

Therefore, we buffer the modifier state information and update it in the IO
object right before we call igNewFrame.
This commit is contained in:
Quantum
2021-08-19 15:57:20 -04:00
committed by Geoffrey McRae
parent c0fa6c414c
commit 9bd205a527
2 changed files with 13 additions and 4 deletions

View File

@@ -56,6 +56,10 @@ struct AppState
bool overlayInput;
ImGuiMouseCursor cursorLast;
char * imGuiIni;
bool modCtrl;
bool modShift;
bool modAlt;
bool modSuper;
bool alertShow;
char * alertMessage;