mirror of
https://github.com/ocornut/imgui.git
synced 2026-05-28 20:26:06 +08:00
Backends: Win32: Viewports: fixed an issue when closing a window from the OS close button (with io.ConfigViewportsNoDecoration=false) while user code is discarding the 'bool *p_open=false output' from Begin()
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
// CHANGELOG
|
// CHANGELOG
|
||||||
// (minor and older changes stripped away, please see git history for details)
|
// (minor and older changes stripped away, please see git history for details)
|
||||||
// 2025-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
|
// 2025-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
|
||||||
|
// 2025-03-26: [Docking] Viewports: fixed an issue when closing a window from the OS close button (with io.ConfigViewportsNoDecoration = false) while user code was discarding the 'bool* p_open = false' output from Begin(). Because we allowed the Win32 window to close early, Windows destroyed it and our imgui window became not visible even though user code was still submitting it.
|
||||||
// 2025-03-10: When dealing with OEM keys, use scancodes instead of translated keycodes to choose ImGuiKey values. (#7136, #7201, #7206, #7306, #7670, #7672, #8468)
|
// 2025-03-10: When dealing with OEM keys, use scancodes instead of translated keycodes to choose ImGuiKey values. (#7136, #7201, #7206, #7306, #7670, #7672, #8468)
|
||||||
// 2025-02-21: [Docking] WM_SETTINGCHANGE's SPI_SETWORKAREA message also triggers a refresh of monitor list. (#8415)
|
// 2025-02-21: [Docking] WM_SETTINGCHANGE's SPI_SETWORKAREA message also triggers a refresh of monitor list. (#8415)
|
||||||
// 2025-02-18: Added ImGuiMouseCursor_Wait and ImGuiMouseCursor_Progress mouse cursor support.
|
// 2025-02-18: Added ImGuiMouseCursor_Wait and ImGuiMouseCursor_Progress mouse cursor support.
|
||||||
@@ -1357,14 +1358,14 @@ static LRESULT CALLBACK ImGui_ImplWin32_WndProcHandler_PlatformWindow(HWND hWnd,
|
|||||||
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO(ctx);
|
ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO(ctx);
|
||||||
LRESULT result = 0;
|
LRESULT result = 0;
|
||||||
if (ImGui_ImplWin32_WndProcHandlerEx(hWnd, msg, wParam, lParam, io))
|
if (ImGui_ImplWin32_WndProcHandlerEx(hWnd, msg, wParam, lParam, io))
|
||||||
result = true;
|
result = 1;
|
||||||
else if (ImGuiViewport* viewport = ImGui_ImplWin32_FindViewportByPlatformHandle(platform_io, hWnd))
|
else if (ImGuiViewport* viewport = ImGui_ImplWin32_FindViewportByPlatformHandle(platform_io, hWnd))
|
||||||
{
|
{
|
||||||
switch (msg)
|
switch (msg)
|
||||||
{
|
{
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
viewport->PlatformRequestClose = true;
|
viewport->PlatformRequestClose = true;
|
||||||
break;
|
return 0; // 0 = Operating system will ignore the message and not destroy the window. We close ourselves.
|
||||||
case WM_MOVE:
|
case WM_MOVE:
|
||||||
viewport->PlatformRequestMove = true;
|
viewport->PlatformRequestMove = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -48,6 +48,15 @@ Other changes:
|
|||||||
- Style, InputText: added ImGuiCol_InputTextCursor to configure color of
|
- Style, InputText: added ImGuiCol_InputTextCursor to configure color of
|
||||||
the InputText cursor/caret. (#7031)
|
the InputText cursor/caret. (#7031)
|
||||||
|
|
||||||
|
Docking+Viewports Branch:
|
||||||
|
|
||||||
|
- Backends: Win32: Viewports: fixed an issue when closing a window from
|
||||||
|
the OS close button (with io.ConfigViewportsNoDecoration=false) while
|
||||||
|
user code is discarding the 'bool *p_open=false output' from Begin().
|
||||||
|
Because we allowed the Win32 window to close early, Windows destroyed
|
||||||
|
it and our imgui window became not visible even though user code was
|
||||||
|
still submitting it.
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
VERSION 1.91.9b (Released 2025-03-17)
|
VERSION 1.91.9b (Released 2025-03-17)
|
||||||
|
|||||||
Reference in New Issue
Block a user