forked from Imagelibrary/binutils-gdb
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.
This commit is contained in:
@@ -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 ());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user