From d3acf3d759d085df544687b39a0c2900d3117bf7 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 17 Dec 2023 12:52:33 -0700 Subject: Rename tui_suppress_output This patch renames tui_suppress_output to the more descriptive tui_batch_rendering. This code was never really correct, and was based on a misunderstanding of the curses API. The updated comments describe the intended use of this class. This also removes the erroneous tui_win_info::no_refresh. wnoutrefresh does not prevent any output; rather, it copies from one curses buffer to another but (unlike woutrefresh) without then flushing to the screen. tui_batch_rendering now works in the correct way: calling doupdate in the destructor of the outermost instance, thus batching all screen output until that point. The patch adds instantiations of tui_batch_rendering to various spots, to make sure it is active when refreshing. --- gdb/python/py-tui.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gdb/python/py-tui.c') diff --git a/gdb/python/py-tui.c b/gdb/python/py-tui.c index 3bcd02d..b3544c6 100644 --- a/gdb/python/py-tui.c +++ b/gdb/python/py-tui.c @@ -180,6 +180,8 @@ tui_py_window::~tui_py_window () void tui_py_window::rerender () { + tui_batch_rendering batch; + tui_win_info::rerender (); gdbpy_enter enter_py; @@ -206,6 +208,8 @@ tui_py_window::rerender () void tui_py_window::do_scroll_horizontal (int num_to_scroll) { + tui_batch_rendering batch; + gdbpy_enter enter_py; if (PyObject_HasAttrString (m_window.get (), "hscroll")) @@ -220,6 +224,8 @@ tui_py_window::do_scroll_horizontal (int num_to_scroll) void tui_py_window::do_scroll_vertical (int num_to_scroll) { + tui_batch_rendering batch; + gdbpy_enter enter_py; if (PyObject_HasAttrString (m_window.get (), "vscroll")) @@ -242,6 +248,8 @@ tui_py_window::resize (int height_, int width_, int origin_x_, int origin_y_) void tui_py_window::click (int mouse_x, int mouse_y, int mouse_button) { + tui_batch_rendering batch; + gdbpy_enter enter_py; if (PyObject_HasAttrString (m_window.get (), "click")) @@ -258,6 +266,8 @@ tui_py_window::output (const char *text, bool full_window) { if (m_inner_window != nullptr) { + tui_batch_rendering batch; + if (full_window) werase (m_inner_window.get ()); -- cgit v1.1