[binutils-gdb] Prevent flickering when redrawing the TUI python window

Hannes Domani ssbssa@sourceware.org
Mon May 24 15:17:54 GMT 2021


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a56889ae38d650fb77f0790f4157ff90e11fd2d4

commit a56889ae38d650fb77f0790f4157ff90e11fd2d4
Author: Hannes Domani <ssbssa@yahoo.de>
Date:   Tue Dec 22 15:02:47 2020 +0100

    Prevent flickering when redrawing the TUI python window
    
    tui_win_info::refresh_window first redraws the background window, then
    tui_wrefresh draws the python text on top of it, which flickers.
    
    By using wnoutrefresh for the background window, the actual drawing on
    the screen is only done once, without flickering.
    
    gdb/ChangeLog:
    
    2021-05-24  Hannes Domani  <ssbssa@yahoo.de>
    
            * python/py-tui.c (tui_py_window::refresh_window):
            Avoid flickering.

Diff:
---
 gdb/ChangeLog       | 5 +++++
 gdb/python/py-tui.c | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 480d204232a..b24a24be267 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2021-05-24  Hannes Domani  <ssbssa@yahoo.de>
+
+	* python/py-tui.c (tui_py_window::refresh_window):
+	Avoid flickering.
+
 2021-05-23  Tom de Vries  <tdevries@suse.de>
 
 	PR tdep/27822
diff --git a/gdb/python/py-tui.c b/gdb/python/py-tui.c
index 72e9c0d5e2b..22f4b0ffd43 100644
--- a/gdb/python/py-tui.c
+++ b/gdb/python/py-tui.c
@@ -91,12 +91,14 @@ public:
 
   void refresh_window () override
   {
-    tui_win_info::refresh_window ();
     if (m_inner_window != nullptr)
       {
+	wnoutrefresh (handle.get ());
 	touchwin (m_inner_window.get ());
 	tui_wrefresh (m_inner_window.get ());
       }
+    else
+      tui_win_info::refresh_window ();
   }
 
   /* Erase and re-box the window.  */


More information about the Gdb-cvs mailing list