From 4949bd8cd5aebc7f0333074c57a3e61eb8adb637 Mon Sep 17 00:00:00 2001 From: PeterN Date: Sun, 4 Jun 2023 19:15:24 +0100 Subject: [PATCH] Fix dec7ff6b0c: Dropdowns would close if their tooltip appeared. (#10939) Solution is to not focus any tooltips, so that the dropdown doesn't lose focus. Tooltips don't accept any input so this does not change their behaviour. --- src/window.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/window.cpp b/src/window.cpp index e7f5f4f78e..4546c5fc54 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -457,6 +457,9 @@ void SetFocusedWindow(Window *w) { if (_focused_window == w) return; + /* Don't focus a tooltip */ + if (w != nullptr && w->window_class == WC_TOOLTIPS) return; + /* Invalidate focused widget */ if (_focused_window != nullptr) { if (_focused_window->nested_focus != nullptr) _focused_window->nested_focus->SetDirty(_focused_window);