Ver código fonte

LibGUI: Don't let widgets hide tooltips they didn't show

Widget::handle_leave_event() hides the tooltip if one is shown. That's
usually fine and hides the widget's tooltip, but it can happen that
another widget managed to show a tooltip after the Leave event was
triggered and before it's processed.

Thus change handle_leave_event() to only hide the tooltip if it was show
by the widget.

Fixes the case where this could happen in the flame graph in Profiler
when moving the mouse over the tooltip window itself #14852.
David Smith 3 anos atrás
pai
commit
2a386c0b50
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      Userland/Libraries/LibGUI/Widget.cpp

+ 2 - 1
Userland/Libraries/LibGUI/Widget.cpp

@@ -466,7 +466,8 @@ void Widget::handle_leave_event(Core::Event& event)
 {
     if (auto* window = this->window())
         window->update_cursor({});
-    Application::the()->hide_tooltip();
+    if (Application::the()->tooltip_source_widget() == this)
+        Application::the()->hide_tooltip();
     leave_event(event);
 }