From 168b4b775b6271c4a3ae2b0047e8d81fbda4e618 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 16 Sep 2013 19:25:18 +0100 Subject: [PATCH] Do not clear Client::m_mode_trash in handle_key, but in handle_available_input handle_key can be called from exec_keys while running a hook, and a previous key in exec_keys could have changed the mode. This would make the mode that runned the hook deleted when the controls returns to it. handle_available_input should always be called at top level, so can safely clear the mode trash. --- src/client.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client.cc b/src/client.cc index 08ae32c7f..22f334a60 100644 --- a/src/client.cc +++ b/src/client.cc @@ -981,7 +981,10 @@ bool is_valid(Key key) void Client::handle_available_input() { while (m_ui->is_key_available()) + { handle_key(m_ui->get_key()); + m_mode_trash.clear(); + } m_context.window().forget_timestamp(); } @@ -997,7 +1000,6 @@ void Client::handle_key(Key key) if (was_recording and is_recording()) m_recorded_keys += key_to_str(key); } - m_mode_trash.clear(); } void Client::start_recording(char reg)