mirror of
https://github.com/ocornut/imgui.git
synced 2026-05-17 23:37:12 +08:00
Windows: changed how g.CurrentItemFlags is modified before windows' CloseButton() submission to be less misleading. (#8903)
build / Windows (push) Has been cancelled
build / Linux (push) Has been cancelled
build / MacOS (push) Has been cancelled
build / iOS (push) Has been cancelled
build / Emscripten (push) Has been cancelled
build / Android (push) Has been cancelled
scheduled / scheduled (push) Has been cancelled
build / Windows (push) Has been cancelled
build / Linux (push) Has been cancelled
build / MacOS (push) Has been cancelled
build / iOS (push) Has been cancelled
build / Emscripten (push) Has been cancelled
build / Android (push) Has been cancelled
scheduled / scheduled (push) Has been cancelled
I don't think anyone would have `ImGuiItemFlags_NoFocus` set globally but technically it might.
This commit is contained in:
@@ -7113,10 +7113,11 @@ void ImGui::RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& titl
|
||||
// Close button
|
||||
if (has_close_button)
|
||||
{
|
||||
ImGuiItemFlags backup_item_flags = g.CurrentItemFlags;
|
||||
g.CurrentItemFlags |= ImGuiItemFlags_NoFocus;
|
||||
if (CloseButton(window->GetID("#CLOSE"), close_button_pos))
|
||||
*p_open = false;
|
||||
g.CurrentItemFlags &= ~ImGuiItemFlags_NoFocus;
|
||||
g.CurrentItemFlags = backup_item_flags;
|
||||
}
|
||||
|
||||
window->DC.NavLayerCurrent = ImGuiNavLayer_Main;
|
||||
|
||||
Reference in New Issue
Block a user