1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-22 07:13:07 +01:00

Ignore dead windows for auto positioning

This commit is contained in:
ζeh Matt
2023-06-27 17:37:49 +03:00
parent 5497601d42
commit 6807d508d0

View File

@@ -38,6 +38,8 @@ static bool WindowFitsBetweenOthers(const ScreenCoordsXY& loc, int32_t width, in
{ {
for (auto& w : g_window_list) for (auto& w : g_window_list)
{ {
if (w->flags & WF_DEAD)
continue;
if (w->flags & WF_STICK_TO_BACK) if (w->flags & WF_STICK_TO_BACK)
continue; continue;
@@ -131,6 +133,8 @@ static ScreenCoordsXY GetAutoPositionForNewWindow(int32_t width, int32_t height)
// Place window next to another // Place window next to another
for (auto& w : g_window_list) for (auto& w : g_window_list)
{ {
if (w->flags & WF_DEAD)
continue;
if (w->flags & WF_STICK_TO_BACK) if (w->flags & WF_STICK_TO_BACK)
continue; continue;
@@ -158,6 +162,8 @@ static ScreenCoordsXY GetAutoPositionForNewWindow(int32_t width, int32_t height)
// Overlap // Overlap
for (auto& w : g_window_list) for (auto& w : g_window_list)
{ {
if (w->flags & WF_DEAD)
continue;
if (w->flags & WF_STICK_TO_BACK) if (w->flags & WF_STICK_TO_BACK)
continue; continue;
@@ -222,6 +228,8 @@ WindowBase* WindowCreate(
// Close least recently used window // Close least recently used window
for (auto& w : g_window_list) for (auto& w : g_window_list)
{ {
if (w->flags & WF_DEAD)
continue;
if (!(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT | WF_NO_AUTO_CLOSE))) if (!(w->flags & (WF_STICK_TO_BACK | WF_STICK_TO_FRONT | WF_NO_AUTO_CLOSE)))
{ {
WindowClose(*w.get()); WindowClose(*w.get());