From f31b9e1fccf998abad421b7263d12f013ff9ae6b Mon Sep 17 00:00:00 2001 From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com> Date: Wed, 28 Jan 2026 00:37:20 +1000 Subject: [PATCH] show editor hover info without editor focus --- src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs | 1 - .../Features/CodeEditor/SharpIdeCodeEdit_SymbolHover.cs | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs b/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs index 7c10c82..95ce3f3 100644 --- a/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs +++ b/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit.cs @@ -79,7 +79,6 @@ public partial class SharpIdeCodeEdit : CodeEdit SymbolValidate += OnSymbolValidate; SymbolLookup += OnSymbolLookup; LinesEditedFrom += OnLinesEditedFrom; - MouseEntered += () => GrabFocus(true); // fixes symbol hover not appearing when e.g. solution explorer is focused. Same as godot editor GlobalEvents.Instance.SolutionAltered.Subscribe(OnSolutionAltered); SetCodeRegionTags("#region", "#endregion"); //AddGitGutter(); diff --git a/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit_SymbolHover.cs b/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit_SymbolHover.cs index f57976e..5175186 100644 --- a/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit_SymbolHover.cs +++ b/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit_SymbolHover.cs @@ -18,8 +18,7 @@ public partial class SharpIdeCodeEdit // This method is a bit of a disaster - we create an additional invisible Window, so that the tooltip window doesn't disappear while the mouse is over the hovered symbol private async void OnSymbolHovered(string symbol, long line, long column) { - if (HasFocus() is false) - return; // only show if we have focus, every tab is currently listening for this event, maybe find a better way + if (Visible is false) return; // This should never return false, as this signal should not be emitted when this SharpIdeCodeEdit is not the selected tab, ie the control is not visible var globalMousePosition = GetGlobalMousePosition(); // don't breakpoint before this, else your mouse position will be wrong var lineHeight = GetLineHeight(); GD.Print($"Symbol hovered: {symbol} at line {line}, column {column}");