ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
61.15k stars 10.3k forks source link

The mouse position in the non-client area cannot be refreshed after closing the Modal window. #7385

Closed o-3-o closed 1 month ago

o-3-o commented 8 months ago

Version/Branch of Dear ImGui:

Version 1.90.5, Branch: docking (master/docking/etc.)

Back-ends:

imgui_impl_DX11.cpp + imgui_impl_Win32.cpp

Compiler, OS:

Win11 + MSVC2022

Full config/build information:

Dear ImGui 1.90.5 WIP (19044)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=199711
define: _WIN32
define: _WIN64
define: _MSC_VER=1939
define: _MSVC_LANG=201402
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK
--------------------------------
io.BackendPlatformName: imgui_impl_win32
io.BackendRendererName: imgui_impl_dx11
io.ConfigFlags: 0x00000443
 NavEnableKeyboard
 NavEnableGamepad
 DockingEnable
 ViewportsEnable
io.ConfigViewportsNoDecoration
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x00001C0E
 HasMouseCursors
 HasSetMousePos
 PlatformHasViewports
 HasMouseHoveredViewport
 RendererHasVtxOffset
 RendererHasViewports
--------------------------------
io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 512,64
io.DisplaySize: 1264.00,761.00
io.DisplayFramebufferScale: 1.00,1.00
--------------------------------
style.WindowPadding: 8.00,8.00
style.WindowBorderSize: 1.00
style.FramePadding: 4.00,3.00
style.FrameRounding: 0.00
style.FrameBorderSize: 0.00
style.ItemSpacing: 8.00,4.00
style.ItemInnerSpacing: 4.00,4.00

Details:

My Issue/Question:

When using multi-view to separate from the main window, if a Modal window pops up and then click to close the Modal window, if the mouse has not entered the main window during the closing process, ImGui will not update the mouse position event in the non-client area of the mouse unless the mouse is Enter the main window again!

Screenshots/Video:

play

Minimal, Complete and Verifiable Example code:

min examples:

https://github.com/ocornut/imgui/blob/docking/examples/example_win32_directx11/main.cpp

o-3-o commented 8 months ago

After testing, not only the Modal window will be like this, but all pop-up sub-windows will be like this.

The solution is to send a WM_NCMOUSEMOVE message to the main window after ImGui_ImplWin32_DestroyWindow

ocornut commented 8 months ago

Hello, thanks for reporting. Why closing the issue?

o-3-o commented 8 months ago

Hello, thanks for reporting. Why closing the issue?

Sorry, I see you haven't responded, so I don't think it's a mistake.

o-3-o commented 1 month ago

This problem has been fixed in v1.91.2

ocornut commented 1 month ago

I think it was the same as #7971