瀏覽代碼

fix(gtk): redraw all windows after input

Resolved 'focus jumping' illusion by ensuring all windows (including split panes) are redrawn after input. Previously only the primary window was redrawn, making it appear as if action was occurring in the wrong window.
Bernardo Magri 1 月之前
父節點
當前提交
5db16fd31a
共有 2 個文件被更改,包括 7 次插入7 次删除
  1. 1 1
      scripts/build.sh
  2. 6 6
      src/gtk_editor.cpp

+ 1 - 1
scripts/build.sh

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 set -e # Exit immediately if a command exits with a non-zero status
 

+ 6 - 6
src/gtk_editor.cpp

@@ -797,7 +797,7 @@ protected:
                 mode_ = Mode::Normal;
                 command_buffer_.clear();
                 message_line_ = "Cancelled";
-                if (drawing_area_) drawing_area_->queue_draw();
+                if (content_widget_) queue_redraw_all_windows(content_widget_);
                 return true;
             }
             
@@ -820,20 +820,20 @@ protected:
 
                 mode_ = Mode::Normal;
                 command_buffer_.clear();
-                if (drawing_area_) drawing_area_->queue_draw();
+                if (content_widget_) queue_redraw_all_windows(content_widget_);
                 return true;
             }
             
             if (key_name == "Backspace") {
                 if (!command_buffer_.empty()) command_buffer_.pop_back();
-                if (drawing_area_) drawing_area_->queue_draw();
+                if (content_widget_) queue_redraw_all_windows(content_widget_);
                 return true;
             }
             
             // Simple character input
             if (key_name.length() == 1 && !is_control && !is_lumacs_meta) {
                 command_buffer_ += key_name;
-                if (drawing_area_) drawing_area_->queue_draw();
+                if (content_widget_) queue_redraw_all_windows(content_widget_);
                 return true;
             }
             
@@ -936,8 +936,8 @@ protected:
         }
 
         // Request redraw after processing input
-        if (drawing_area_) {
-            drawing_area_->queue_draw();
+        if (content_widget_) {
+            queue_redraw_all_windows(content_widget_);
         }
         return true;
     }