mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-20 01:34:20 +00:00
Nav: workaround to kindly handle ALT-TAB without detecting TAB-release on backends that clear all keys on unfocus. (#787)
This commit is contained in:
parent
c851b33352
commit
bed6ef03f5
2 changed files with 6 additions and 2 deletions
|
|
@ -2780,9 +2780,11 @@ static void ImGui::NavUpdateWindowing()
|
|||
apply_focus_window = g.NavWindowingTarget;
|
||||
}
|
||||
|
||||
// Keyboard: Press and release ALT to toggle menu layer
|
||||
// Keyboard: Press and Release ALT to toggle menu layer
|
||||
// FIXME: We lack an explicit IO variable for "is the imgui window focused", so compare mouse validity to detect the common case of backend clearing releases all keys on ALT-TAB
|
||||
if ((g.ActiveId == 0 || g.ActiveIdAllowOverlap) && IsNavInputPressed(ImGuiNavInput_KeyMenu, ImGuiInputReadMode_Released))
|
||||
apply_toggle_layer = true;
|
||||
if (IsMousePosValid(&g.IO.MousePos) == IsMousePosValid(&g.IO.MousePosPrev))
|
||||
apply_toggle_layer = true;
|
||||
|
||||
// Move window
|
||||
if (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoMove))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue