Fix modifier key window not always updating

This commit is contained in:
Jonathan G Rennison
2019-10-06 05:21:16 +01:00
parent 9742a161b3
commit 04cf7d5500
3 changed files with 11 additions and 3 deletions

View File

@@ -1380,10 +1380,9 @@ struct ModifierKeyToggleWindow : Window {
this->SetDirty(); this->SetDirty();
} }
EventState OnCTRLStateChange() override void OnCTRLStateChangeAlways() override
{ {
this->UpdateButtons(); this->UpdateButtons();
return ES_NOT_HANDLED;
} }
void OnShiftStateChange() override void OnShiftStateChange() override

View File

@@ -2748,7 +2748,11 @@ void HandleCtrlChanged()
/* Call the event, start with the uppermost window. */ /* Call the event, start with the uppermost window. */
Window *w; Window *w;
FOR_ALL_WINDOWS_FROM_FRONT(w) { FOR_ALL_WINDOWS_FROM_FRONT(w) {
if (w->OnCTRLStateChange() == ES_HANDLED) return; if (w->OnCTRLStateChange() == ES_HANDLED) break;
w->OnCTRLStateChangeAlways();
}
FOR_ALL_WINDOWS_FROM_FRONT_FROM(w, w) {
w->OnCTRLStateChangeAlways();
} }
} }

View File

@@ -667,6 +667,11 @@ public:
*/ */
virtual EventState OnCTRLStateChange() { return ES_NOT_HANDLED; } virtual EventState OnCTRLStateChange() { return ES_NOT_HANDLED; }
/**
* The state of the control key has changed, this is sent even if an OnCTRLStateChange handler has return ES_HANDLED
*/
virtual void OnCTRLStateChangeAlways() {}
/** /**
* The state of the shift key has changed * The state of the shift key has changed
*/ */