Change window close/deallocation to match upstream

This commit is contained in:
Jonathan G Rennison
2023-09-15 23:56:33 +01:00
parent 79cfc3e8bd
commit f5d1b1d8f8
50 changed files with 352 additions and 341 deletions

View File

@@ -370,11 +370,12 @@ struct TimetableWindow : GeneralVehicleWindow {
this->owner = this->vehicle->owner;
}
~TimetableWindow()
void Close() override
{
if (!FocusWindowById(WC_VEHICLE_VIEW, this->window_number)) {
MarkDirtyFocusedRoutePaths(this->vehicle);
}
this->GeneralVehicleWindow::Close();
}
/**
@@ -1165,7 +1166,7 @@ struct TimetableWindow : GeneralVehicleWindow {
}
}
virtual void OnFocusLost(Window *newly_focused_window) override
virtual void OnFocusLost(bool closing, Window *newly_focused_window) override
{
if (HasFocusedVehicleChanged(this->window_number, newly_focused_window)) {
MarkDirtyFocusedRoutePaths(this->vehicle);