### 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
int file_dialog_option;
	void _file_dialog_action(String p_file);
	Ref<Script> _get_current_script();
	TypedArray<Script> _get_open_scripts() const;
	HashSet<String> textfile_extensions;
	Ref<TextFile> _load_text_file(const String &p_path, Error *r_error) const;
	Error _save_text_file(Ref<TextFile> p_text_file, const String &p_path);
	void _on_find_in_files_requested(String text);
	void _on_replace_in_files_requested(String text);
	void _on_find_in_files_result_selected(String fpath, int line_number, int begin, int end);
	void _start_find_in_files(bool with_replace);
	void _on_find_in_files_modified_files(PackedStringArray paths);
	void _window_changed(bool p_visible);
	static void _open_script_request(const String &p_path);
	void _close_builtin_scripts_from_scene(const String &p_scene);
	static ScriptEditor *script_editor;
protected:
	void _notification(int p_what);
	static void _bind_methods();
public:
	static ScriptEditor *get_singleton() { return script_editor; }
	bool toggle_scripts_panel();
	bool is_scripts_panel_toggled();
	void apply_scripts() const;
	void reload_scripts(bool p_refresh_only = false);
	void open_script_create_dialog(const String &p_base_name, const String &p_base_path);
	void open_text_file_create_dialog(const String &p_base_path, const String &p_base_name = "");
	Ref<Resource> open_file(const String &p_file);
	void ensure_select_current();
	_FORCE_INLINE_ bool edit(const Ref<Resource> &p_resource, bool p_grab_focus = true) { return edit(p_resource, -1, 0, p_grab_focus); }