mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
Fix modifier key window not always updating
This commit is contained in:
parent
9742a161b3
commit
04cf7d5500
@ -1380,10 +1380,9 @@ struct ModifierKeyToggleWindow : Window {
|
||||
this->SetDirty();
|
||||
}
|
||||
|
||||
EventState OnCTRLStateChange() override
|
||||
void OnCTRLStateChangeAlways() override
|
||||
{
|
||||
this->UpdateButtons();
|
||||
return ES_NOT_HANDLED;
|
||||
}
|
||||
|
||||
void OnShiftStateChange() override
|
||||
|
@ -2748,7 +2748,11 @@ void HandleCtrlChanged()
|
||||
/* Call the event, start with the uppermost window. */
|
||||
Window *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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -667,6 +667,11 @@ public:
|
||||
*/
|
||||
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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user