From 73899fc3074d21f99b7ea8fe4df587a3142c5fd5 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 14 Nov 2016 11:31:36 +0100 Subject: [PATCH] Don't show tooltips if the mouse cursor is outside the control --- renderdocui/Controls/TreeListView/TreeListView.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/renderdocui/Controls/TreeListView/TreeListView.cs b/renderdocui/Controls/TreeListView/TreeListView.cs index 742ad2d4f..0a5d822ec 100644 --- a/renderdocui/Controls/TreeListView/TreeListView.cs +++ b/renderdocui/Controls/TreeListView/TreeListView.cs @@ -228,11 +228,22 @@ namespace TreelistView { m_tooltipTimer.Stop(); - if(m_tooltipNode == null) + if (m_tooltipNode == null) + { + m_tooltip.Hide(this); return; + } Node node = m_tooltipNode; + Point p = PointToClient(Cursor.Position); + + if (!ClientRectangle.Contains(p)) + { + m_tooltip.Hide(this); + return; + } + int visibleRowIndex = CalcHitRow(PointToClient(Cursor.Position)); Rectangle rowRect = CalcRowRectangle(visibleRowIndex);