nitpicker: allow refocus during global key ops

This commit is contained in:
Norman Feske 2015-10-08 18:44:13 +02:00 committed by Christian Helmuth
parent f01b205c30
commit a01a423c91
2 changed files with 14 additions and 6 deletions

View File

@ -30,6 +30,13 @@ class Mode
Session *_next_focused_session = nullptr;
protected:
/*
* True while a global key sequence is processed
*/
bool _global_key_sequence = false;
public:
virtual ~Mode() { }
@ -64,7 +71,13 @@ class Mode
*/
void apply_pending_focus_change()
{
if (key_is_pressed())
/*
* Defer focus changes to a point where no drag operation is in
* flight because otherwise, the involved sessions would obtain
* inconsistent press and release events. However, focus changes
* during global key sequences are fine.
*/
if (key_is_pressed() && !_global_key_sequence)
return;
if (_focused_session != _next_focused_session)

View File

@ -46,11 +46,6 @@ class User_state : public Mode, public View_stack
*/
Session *_input_receiver = nullptr;
/*
* True while a global key sequence is processed
*/
bool _global_key_sequence = false;
void _update_all();
public: