ocornut / imgui

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

Tooltip stays on top of other platform windows when Alt+Tabbing #4100

Open Bizzarrus opened 3 years ago

Bizzarrus commented 3 years ago

Version/Branch of Dear ImGui:

Version: 1.83 WIP Branch: docking

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_win32.cpp + imgui_impl_dx11.cpp Compiler: MSVC (Visual Studio 2019) Operating System: Windows 10

My Issue/Question:

Under specific circumstances, the tooltip of an interactable item will stay visible when switching to another platform window using Alt+Tab. That tooltip then stays visible until the main application is focused again. Note: This probably happens for every Win32 back-end, but I only tried directX 11

Screenshots/Video (This screenshot shows a snipped of Visual Studio, where the tooltip of a slider from the demo app stays on top of visual studio)

image

Standalone, minimal, complete and verifiable example: Open the example_win32_directx11 app (does not require any code modifications). Navigate to Widges > Vertical Sliders. Resize the window such that the tooltip of one of these sliders extends to outside of the main application window. Interact with that slider, then use Alt+Tab to switch focus between windows. After repeating the Alt+Tab combo a few times, the tooltip of that slider will stay visible even though the main application window is not focused anymore, and will then stay visible and on top of other windows until the main application gets focused again.

This seems to be triggered when the slider gets focused by Dear ImGui's Nav system (when pressing the alt key as part of the alt+tab key combo), and only happens if the tooltip has it's own platform window.

ocornut commented 3 years ago

This seems to be triggered when the slider gets focused by Dear ImGui's Nav system (when pressing the alt key as part of the alt+tab key combo), and only happens if the tooltip has it's own platform window.

Good catch. I was about to say that mouse coordinates should be disabled and therefore tooltip off, but at the moment when keyboard navigation is active, IsItemHovered() will return true, and tooltip windows are marked as "Top most".

I am not exactly sure what the correct fix for that is.