Repository: godotengine/godot (language: cpp)

Issue:
Ctrl+C and Ctrl+V shortcuts are broken, they apply to the wrong tab
### Tested versions

v4.2.1.stable.mono.official [b09f793f5]



### System information

Godot v4.2.1.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 6GB (NVIDIA; 31.0.15.3623) - AMD Ryzen 5 2600X Six-Core Processor (12 Threads)

### Issue description

When I try to use Ctrl+C and Ctrl+V to copy and paste an object in my scene, it instead for some reason pastes an option in the `Import` tab.

- I do not have the `Import` tab open, I have the `Scene` tab open.
- I do not even have something selected in the `FileSystem` tab which would show up in the `Import` tab when I switch to it.
- But nonetheless I get `Set meshes/force_disable_compression` in the output when trying to Ctrl+C and Ctrl+V, which was the most recent setting I changed in the `Import` tab before moving on to other tasks.

Using the right click menu and selecting `Copy` and then selecting `Paste` works as intended. For some reason it is just the keyboard shortcut which is broken.

### Steps to reproduce

1. change a setting in the `Import` tab
2. try to copy something in the `Scene` tab
3. it will do nothing and the output will show that it just affected whatever setting you changed in the `Import` tab.

### Minimal reproduction project (MRP)

Open a brand new project and follow the steps. Change an import setting of icon.svg and now you cannot Ctrl+C Ctrl+V in the `Scene` tab


Discussion / hints:
- Related to https://github.com/godotengine/godot/issues/70673.

This is an editor shortcut focus issue (a shortcut is global when it shouldn't be), which is a recurring issue throughout the editor.

Fix patch:
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index d9bead1e7832..5611d00814f3 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -579,6 +579,12 @@ void EditorProperty::_notification(int p_what) {
 			}
 		} break;
 		case NOTIFICATION_ENTER_TREE: {
+			EditorInspector *inspector = get_parent_inspector();
+			if (inspector) {
+				inspector = inspector->get_root_inspector();
+			}
+			set_shortcut_context(inspector);
+
 			if (has_borders) {
 				get_parent()->connect(SceneStringName(theme_changed), callable_mp(this, &EditorProperty::_update_property_bg));
 				_update_property_bg();


Test patch: