From 1d543e46ae15eaf31665c2d1b5d8abef863c0a81 Mon Sep 17 00:00:00 2001 From: Lukas1811 <40807034+Lukas1811@users.noreply.github.com> Date: Sat, 28 Feb 2026 13:21:40 +0100 Subject: [PATCH 1/2] Force tooltip window to be child of main viewport --- src/ngscopeclient/CreateFilterBrowser.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ngscopeclient/CreateFilterBrowser.cpp b/src/ngscopeclient/CreateFilterBrowser.cpp index 57b025bf6..e161d34e0 100644 --- a/src/ngscopeclient/CreateFilterBrowser.cpp +++ b/src/ngscopeclient/CreateFilterBrowser.cpp @@ -166,6 +166,11 @@ bool CreateFilterBrowser::DoRender() if(ImGui::IsItemHovered(ImGuiHoveredFlags_ForTooltip) && !mouseIsDown && !isDragging) { + // The tooltip introduced some issues on tiling window managers since it sometimes created + // a second OS window when ImGuiConfigFlags_ViewportsEnable was set as a config flag to ImGui. + // This forces the tooltip to be a child of the main viewport. + ImGui::SetNextWindowViewport(ImGui::GetMainViewport()->ID); + // Don't put anything in between since this could lead to the SetNextWindowViewport call affecting other windows. if(ImGui::BeginTooltip()) { ImGui::TextUnformatted(it.first.c_str()); From b4d36c1b1ffdb5f23fa40fafb3a07b7995ef6af6 Mon Sep 17 00:00:00 2001 From: Lukas1811 <40807034+Lukas1811@users.noreply.github.com> Date: Sat, 28 Feb 2026 13:33:03 +0100 Subject: [PATCH 2/2] Use current window viewport instead of main viewport --- src/ngscopeclient/CreateFilterBrowser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ngscopeclient/CreateFilterBrowser.cpp b/src/ngscopeclient/CreateFilterBrowser.cpp index e161d34e0..50dc52f0d 100644 --- a/src/ngscopeclient/CreateFilterBrowser.cpp +++ b/src/ngscopeclient/CreateFilterBrowser.cpp @@ -168,8 +168,8 @@ bool CreateFilterBrowser::DoRender() { // The tooltip introduced some issues on tiling window managers since it sometimes created // a second OS window when ImGuiConfigFlags_ViewportsEnable was set as a config flag to ImGui. - // This forces the tooltip to be a child of the main viewport. - ImGui::SetNextWindowViewport(ImGui::GetMainViewport()->ID); + // This forces the tooltip to be a child of the viewport of the currently active window. + ImGui::SetNextWindowViewport(ImGui::GetWindowViewport()->ID); // Don't put anything in between since this could lead to the SetNextWindowViewport call affecting other windows. if(ImGui::BeginTooltip()) {