|
|
@@ -63,6 +63,7 @@ public:
|
|
|
// Safety check during destruction
|
|
|
if (!core_ || !app_) return;
|
|
|
|
|
|
+
|
|
|
// Handle layout changes
|
|
|
if (event == EditorEvent::WindowLayoutChanged) {
|
|
|
rebuild_layout();
|
|
|
@@ -397,13 +398,13 @@ protected:
|
|
|
}, false);
|
|
|
drawing_area->add_controller(controller);
|
|
|
|
|
|
- // Add focus handling to set active window
|
|
|
+ // Add focus handling to set active window (only for visual focus, not for key input)
|
|
|
auto focus_controller = Gtk::EventControllerFocus::create();
|
|
|
std::weak_ptr<Window> weak_window_focus = node->window;
|
|
|
focus_controller->signal_enter().connect([this, weak_window_focus]() {
|
|
|
+ // Only set active window for visual feedback, key handler will override if needed
|
|
|
if (auto window = weak_window_focus.lock()) {
|
|
|
- if (core_) {
|
|
|
- // Use the proper set_active_window method
|
|
|
+ if (core_ && core_->active_window() != window) {
|
|
|
core_->set_active_window(window);
|
|
|
}
|
|
|
}
|
|
|
@@ -512,7 +513,8 @@ protected:
|
|
|
}
|
|
|
|
|
|
// Render Cursor if this is the active window
|
|
|
- if (window == core_->active_window() && cursor_visible_ &&
|
|
|
+ bool should_show_cursor = (window == core_->active_window()) && cursor_visible_;
|
|
|
+ if (should_show_cursor &&
|
|
|
cursor.line >= static_cast<size_t>(start_line) &&
|
|
|
cursor.line < static_cast<size_t>(end_line)) {
|
|
|
|