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}");