I had similar issues with other programs. In my case it was PersistentWindows, which I use to make sure that the windows I open keep their position even when I disconnect my second monitor.
I read this as meaning that the editor scrolls to where the cursor is when the window receives focus. The editor may have been scrolled elsewhere so the code could be read without losing the position of the cursor.
That really sounds like an window manager thing, not a godot issue.
I feel like this might be OS/window-manager dependent. There may be a click to focus setting.
Does the same happen if you alt-tab or click on the title bar instead of within the editor?
@pulido not sure. U may have to try new focus habits, like alt tab or clicking the title bar instead.