Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ImGui::SetWindowFocus(nullptr) can cause crash #3865

Closed
wants to merge 1 commit into from
Closed

ImGui::SetWindowFocus(nullptr) can cause crash #3865

wants to merge 1 commit into from

Conversation

nem0
Copy link
Contributor

@nem0 nem0 commented Mar 2, 2021

Steps to reproduce:

  1. put ImGui::SetWindowFocus(nullptr); before if (!ImGui::Begin("Dear ImGui Demo" in demo
  2. start demo
  3. dock two windows together
  4. click on docked windows
  5. observe crash in ImGui::ItemAdd

Note: VS2019, win10, latest docking branch version
Note: crashes because NavAnyRequest is true, but NavWindow is null
Note: SetWindowFocus does not update NavAnyRequest

@ocornut ocornut added bug focus nav keyboard/gamepad navigation labels Mar 2, 2021
ocornut added a commit that referenced this pull request Mar 2, 2021
@ocornut
Copy link
Owner

ocornut commented Mar 2, 2021

Thank you for the fix, this is now merged (in master and docking).

Please note that calling SetWindowFocus(NULL) will likely hinder any meaningful interaction, but I imagine your actual usage differs from that sample.

@ocornut ocornut closed this Mar 2, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug focus nav keyboard/gamepad navigation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants