Преглед на файлове

fix(gtk): Restore missing UI elements and input handling

- Fix layout calculation in GtkRenderer to prevent Modeline and Minibuffer from overlapping (drawing at same Y coordinate).
- Update GtkEditor input handling to use CAPTURE propagation phase, ensuring key events are intercepted at the window level before reaching child widgets.
- Add debug logging to key event handler for diagnostics.
Bernardo Magri преди 1 месец
родител
ревизия
2dbb6b0bde
променени са 2 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 3 1
      src/gtk_editor.cpp
  2. 1 1
      src/gtk_renderer.cpp

+ 3 - 1
src/gtk_editor.cpp

@@ -250,6 +250,7 @@ std::string GtkEditor::get_lumacs_key_name(guint keyval, Gdk::ModifierType state
 
 bool GtkEditor::on_global_key_pressed(guint keyval, guint keycode, Gdk::ModifierType state) {
     (void)keycode;
+    spdlog::debug("GtkEditor::on_global_key_pressed: keyval={}, state={}", keyval, (int)state);
     if (!core_) return false;
 
     // Translate GDK event to Lumacs key name
@@ -392,8 +393,9 @@ void GtkEditor::on_activate() {
 
     // Attach global key controller to the main window
     auto global_key_controller = Gtk::EventControllerKey::create();
+    global_key_controller->set_propagation_phase(Gtk::PropagationPhase::CAPTURE);
     global_key_controller->signal_key_pressed().connect(
-        sigc::mem_fun(*this, &GtkEditor::on_global_key_pressed), true // Consume events handled by us
+        sigc::mem_fun(*this, &GtkEditor::on_global_key_pressed), false 
     );
     window_->add_controller(global_key_controller);
 }

+ 1 - 1
src/gtk_renderer.cpp

@@ -312,7 +312,7 @@ void GtkRenderer::render_modeline_for_window(const Cairo::RefPtr<Cairo::Context>
     bool is_active = (window == active_window_cache);
     
     // Calculate modeline position (second line from bottom)
-    double modeline_y = height - line_height_ - PADDING_BOTTOM; // Adjust height - modeline is on line above minibuffer
+    double modeline_y = height - (2 * line_height_) - PADDING_BOTTOM; // Position above minibuffer
     double modeline_x = PADDING_LEFT;
     
     // Get theme colors