Fix redrawing of windows when only the status line changes
This commit is contained in:
parent
90c2647c0b
commit
55866b51d7
|
@ -88,16 +88,21 @@ void Client::change_buffer(Buffer& buffer)
|
|||
|
||||
void Client::redraw_ifn()
|
||||
{
|
||||
if (context().window().timestamp() != context().buffer().timestamp())
|
||||
DisplayLine mode_line = generate_mode_line();
|
||||
const bool buffer_changed = context().window().timestamp() != context().buffer().timestamp();
|
||||
if (buffer_changed or mode_line.atoms() != m_mode_line.atoms())
|
||||
{
|
||||
CharCoord dimensions = context().ui().dimensions();
|
||||
if (dimensions == CharCoord{0,0})
|
||||
return;
|
||||
context().window().set_dimensions(dimensions);
|
||||
context().window().update_display_buffer(context());
|
||||
|
||||
if (buffer_changed)
|
||||
{
|
||||
CharCoord dimensions = context().ui().dimensions();
|
||||
if (dimensions == CharCoord{0,0})
|
||||
return;
|
||||
context().window().set_dimensions(dimensions);
|
||||
context().window().update_display_buffer(context());
|
||||
}
|
||||
m_mode_line = std::move(mode_line);
|
||||
context().ui().draw(context().window().display_buffer(),
|
||||
m_status_line, generate_mode_line());
|
||||
m_status_line, m_mode_line);
|
||||
}
|
||||
context().ui().refresh();
|
||||
}
|
||||
|
|
|
@ -53,6 +53,7 @@ private:
|
|||
InputHandler m_input_handler;
|
||||
|
||||
DisplayLine m_status_line;
|
||||
DisplayLine m_mode_line;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -105,6 +105,13 @@ public:
|
|||
void trim_end(CharCount count);
|
||||
|
||||
void check_invariant() const;
|
||||
|
||||
bool operator==(const DisplayAtom& other) const
|
||||
{
|
||||
return colors == other.colors or attribute == other.attribute or
|
||||
content() == other.content();
|
||||
}
|
||||
|
||||
public:
|
||||
ColorPair colors = {Colors::Default, Colors::Default};
|
||||
Attribute attribute = Normal;
|
||||
|
|
Loading…
Reference in New Issue
Block a user