|
|
@@ -373,6 +373,25 @@ void EditorCore::next_window() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+bool EditorCore::set_active_window(std::shared_ptr<Window> window) {
|
|
|
+ if (!window) return false;
|
|
|
+
|
|
|
+ // Verify that the window exists in the current window tree
|
|
|
+ std::vector<std::shared_ptr<Window>> windows;
|
|
|
+ collect_windows(root_node_.get(), windows);
|
|
|
+
|
|
|
+ auto it = std::find(windows.begin(), windows.end(), window);
|
|
|
+ if (it != windows.end()) {
|
|
|
+ if (active_window_ != window) {
|
|
|
+ active_window_ = window;
|
|
|
+ emit_event(EditorEvent::WindowFocused);
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false; // Window not found in tree
|
|
|
+}
|
|
|
+
|
|
|
// === Cursor Proxies ===
|
|
|
|
|
|
Position EditorCore::cursor() const noexcept {
|