Remove unneeded NCursesUI::Window::mark_dirty and redraws

A bug in client.cc was always forcing full redraws of the windows,
leading to much more terminal output traffic than necessary.
This commit is contained in:
Maxime Coste 2019-09-26 20:14:08 +10:00
parent 7f141e83ce
commit 1d9a9bc308
3 changed files with 1 additions and 10 deletions

View File

@ -261,7 +261,7 @@ void Client::redraw_ifn()
auto cursor = m_input_handler.get_cursor_info();
m_ui->set_cursor(cursor.first, cursor.second);
m_ui->refresh(m_ui_pending | Refresh);
m_ui->refresh(m_ui_pending & Refresh);
m_ui_pending = 0;
}

View File

@ -114,11 +114,6 @@ void NCursesUI::Window::draw(Palette& palette, ConstArrayView<DisplayAtom> atoms
wclrtoeol(win);
}
void NCursesUI::Window::mark_dirty(LineCount pos, LineCount count)
{
wredrawln(win, (int)pos, (int)count);
}
constexpr int NCursesUI::default_shift_function_key;
static constexpr StringView assistant_cat[] =
@ -867,7 +862,6 @@ void NCursesUI::menu_show(ConstArrayView<DisplayLine> items,
{
if (m_menu)
{
m_window.mark_dirty(m_menu.pos.line, m_menu.size.line);
m_menu.destroy();
m_dirty = true;
}
@ -981,7 +975,6 @@ void NCursesUI::menu_hide()
return;
m_menu.items.clear();
m_window.mark_dirty(m_menu.pos.line, m_menu.size.line);
m_menu.destroy();
m_dirty = true;
@ -1181,7 +1174,6 @@ void NCursesUI::info_hide()
{
if (not m_info)
return;
m_window.mark_dirty(m_info.pos.line, m_info.size.line);
m_info.destroy();
m_dirty = true;
}

View File

@ -101,7 +101,6 @@ private:
void destroy();
void refresh(bool force);
void move_cursor(DisplayCoord coord);
void mark_dirty(LineCount pos, LineCount count);
void draw(Palette& palette, ConstArrayView<DisplayAtom> atoms,
ColumnCount width, const Face& default_face);