### Godot version

v4.1.1.stable.official [bd6af8e0e]

### System information

Godot v4.1.1.stable - Ubuntu 23.04 23.04 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 Ti (nvidia; 535.54.03) - 12th Gen Intel(R) Core(TM) i9-12900F (24 Threads)

### Issue description

As per the issue title - in a 3D scene which contains a Control node, clicking that node will switch to the 2D view and allow you to edit the controls visually. Likewise, clicking a node that derives from Node3D will switch back to the 3D view so you can continue to visually work with the selected nodes.

When going into the script window and clicking the button to open the script into a floating window, however, the aforementioned actions no longer work. Closing the script window so it is no longer floating will restore the functionality.

### Steps to reproduce

1. Create a 3D scene
2. Add a Node3D
3. Add a Control
4. Click the Node3D node and see that the editor shows the 3D view
5. Click the Control and see that the editor shows the 2D view
6. Go to the Script tab and click the button to open it as a floating window
7. Repeat steps 4 and 5 to see that either the 3D view or 2D view will remain the active view regardless of which node is selected
8. Close the floating script window and repeat steps 4 and 5 to see they are now working again

### Minimal reproduction project

N/A
virtual PackedInt32Array get_breakpoints() = 0;
	virtual void set_breakpoint(int p_line, bool p_enabled) = 0;
	virtual void clear_breakpoints() = 0;
	virtual void add_callback(const String &p_function, PackedStringArray p_args) = 0;
	virtual void update_settings() = 0;
	virtual void set_debugger_active(bool p_active) = 0;
	virtual bool can_lose_focus_on_node_selection() { return true; }
	virtual void update_toggle_scripts_button() {}
	virtual bool show_members_overview() = 0;
	virtual void set_tooltip_request_func(const Callable &p_toolip_callback) = 0;
	virtual Control *get_edit_menu() = 0;
	virtual void clear_edit_menu() = 0;
	virtual void set_find_replace_bar(FindReplaceBar *p_bar) = 0;
	virtual Control *get_base_editor() const = 0;
	virtual void validate() = 0;
	ScriptEditorBase() {}
};
typedef ScriptEditorBase *(*CreateScriptEditorFunc)(const Ref<Resource> &p_resource);
class EditorScriptCodeCompletionCache;
class FindInFilesDialog;
class FindInFilesPanel;
class ScriptEditor : public PanelContainer {
	GDCLASS(ScriptEditor, PanelContainer);
	enum {
		FILE_NEW,
		FILE_NEW_TEXTFILE,
		FILE_OPEN,