summaryrefslogtreecommitdiff
path: root/src/client.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2016-03-07 13:54:20 +0000
committerMaxime Coste <frrrwww@gmail.com>2016-03-07 21:44:50 +0000
commitf1fb2114da0a0e293e94adf307da456449fea76d (patch)
tree33a6daf050d4508fbff42ea8d5a33a662466371b /src/client.cc
parent26e81976d337f13ab238b55768a9b979b4860101 (diff)
Handle <c-l> redrawing on the server side
That way we can force a redraw at any moment, including during batch execution.
Diffstat (limited to 'src/client.cc')
-rw-r--r--src/client.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/client.cc b/src/client.cc
index 7dd22f88..d9fbf946 100644
--- a/src/client.cc
+++ b/src/client.cc
@@ -77,6 +77,8 @@ void Client::handle_available_input(EventMode mode)
{
if (*key == ctrl('c'))
killpg(getpgrp(), SIGINT);
+ if (*key == ctrl('l'))
+ redraw_ifn(true);
else if (*key == Key::FocusIn)
context().hooks().run_hook("FocusIn", context().name(), context());
else if (*key == Key::FocusOut)
@@ -171,18 +173,18 @@ static bool is_inline(InfoStyle style)
style == InfoStyle::InlineBelow;
}
-void Client::redraw_ifn()
+void Client::redraw_ifn(bool force)
{
Window& window = context().window();
const bool needs_redraw = window.needs_redraw(context());
- if (needs_redraw)
+ if (needs_redraw or force)
{
auto window_pos = window.position();
m_ui->draw(window.update_display_buffer(context()), get_face("Default"));
// window moved, reanchor eventual menu and info
- if (window_pos != window.position())
+ if (force or window_pos != window.position())
{
if (not m_menu.items.empty() and m_menu.style == MenuStyle::Inline)
{
@@ -199,7 +201,7 @@ void Client::redraw_ifn()
}
DisplayLine mode_line = generate_mode_line();
- if (needs_redraw or
+ if (force or needs_redraw or
m_status_line.atoms() != m_pending_status_line.atoms() or
mode_line.atoms() != m_mode_line.atoms())
{
@@ -210,10 +212,10 @@ void Client::redraw_ifn()
m_ui_dirty = true;
}
- if (m_ui_dirty)
+ if (m_ui_dirty or force)
{
m_ui_dirty = false;
- m_ui->refresh();
+ m_ui->refresh(force);
}
}