mirror of
https://github.com/Drezil/imgui.git
synced 2025-09-18 00:53:14 +02: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:
@ -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))
|
||||
|
Reference in New Issue
Block a user