### 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
c = tab_container->get_current_tab_control();
	if (Object::cast_to<ScriptEditorBase>(c)) {
		script_name_label->set_text(Object::cast_to<ScriptEditorBase>(c)->get_name());
		script_icon->set_texture(Object::cast_to<ScriptEditorBase>(c)->get_theme_icon());
		if (is_visible_in_tree()) {
			Object::cast_to<ScriptEditorBase>(c)->ensure_focus();
		}
		Ref<Script> scr = Object::cast_to<ScriptEditorBase>(c)->get_edited_resource();
		if (scr != nullptr) {
			notify_script_changed(scr);
		}
		Object::cast_to<ScriptEditorBase>(c)->validate();
	}
	if (Object::cast_to<EditorHelp>(c)) {
		script_name_label->set_text(Object::cast_to<EditorHelp>(c)->get_class());
		script_icon->set_texture(get_theme_icon(SNAME("Help"), SNAME("EditorIcons")));
		if (is_visible_in_tree()) {
			Object::cast_to<EditorHelp>(c)->set_focused();
		}
	}
	c->set_meta("__editor_pass", ++edit_pass);
	_update_history_arrows();
	_update_script_colors();
	_update_members_overview();
	_update_help_overview();
	_update_selected_editor_menu();
	_update_members_overview_visibility();
	_update_help_overview_visibility();
}
void ScriptEditor::_add_recent_script(String p_path) {