Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ friend class GameWindow;
protected:

void processDestroyList(); ///< process windows waiting to be killed
void removeWindowFromModalStack( GameWindow *window );

Int drawWindow( GameWindow *window ); ///< draw this window

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ void GameWindowManager::processDestroyList()
if( m_keyboardFocus == doDestroy )
winSetFocus( nullptr );

if( (m_modalHead != nullptr) && (doDestroy == m_modalHead->window) )
winUnsetModal( m_modalHead->window );

if( m_currMouseRgn == doDestroy )
m_currMouseRgn = nullptr;

Expand Down Expand Up @@ -1422,8 +1419,7 @@ Int GameWindowManager::winDestroy( GameWindow *window )
if( m_keyboardFocus == window )
winSetFocus( nullptr );

if( (m_modalHead != nullptr) && (window == m_modalHead->window) )
winUnsetModal( m_modalHead->window );
removeWindowFromModalStack( window );

if( m_currMouseRgn == window )
m_currMouseRgn = nullptr;
Expand Down Expand Up @@ -1555,6 +1551,26 @@ Int GameWindowManager::winUnsetModal( GameWindow *window )

}

// TheSuperHackers @bugfix arcticdolphin 27/08/2026 Remove destroyed windows from the entire modal stack.
void GameWindowManager::removeWindowFromModalStack( GameWindow *window )
{
ModalWindow **link = &m_modalHead;

while( *link )
{
ModalWindow *modal = *link;

if( modal->window != window )
{
link = &modal->next;
continue;
}

*link = modal->next;
deleteInstance(modal);
}
}

//-------------------------------------------------------------------------------------------------
/** Get the grabbed window */
//-------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ friend class GameWindow;
protected:

void processDestroyList(); ///< process windows waiting to be killed
void removeWindowFromModalStack( GameWindow *window );

Int drawWindow( GameWindow *window ); ///< draw this window

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ void GameWindowManager::processDestroyList()
if( m_keyboardFocus == doDestroy )
winSetFocus( nullptr );

if( (m_modalHead != nullptr) && (doDestroy == m_modalHead->window) )
winUnsetModal( m_modalHead->window );

if( m_currMouseRgn == doDestroy )
m_currMouseRgn = nullptr;

Expand Down Expand Up @@ -1422,8 +1419,7 @@ Int GameWindowManager::winDestroy( GameWindow *window )
if( m_keyboardFocus == window )
winSetFocus( nullptr );

if( (m_modalHead != nullptr) && (window == m_modalHead->window) )
winUnsetModal( m_modalHead->window );
removeWindowFromModalStack( window );

if( m_currMouseRgn == window )
m_currMouseRgn = nullptr;
Expand Down Expand Up @@ -1555,6 +1551,26 @@ Int GameWindowManager::winUnsetModal( GameWindow *window )

}

// TheSuperHackers @bugfix arcticdolphin 27/08/2026 Remove destroyed windows from the entire modal stack.
void GameWindowManager::removeWindowFromModalStack( GameWindow *window )
{
ModalWindow **link = &m_modalHead;

while( *link )
{
ModalWindow *modal = *link;

if( modal->window != window )
{
link = &modal->next;
continue;
}

*link = modal->next;
deleteInstance(modal);
}
}

//-------------------------------------------------------------------------------------------------
/** Get the grabbed window */
//-------------------------------------------------------------------------------------------------
Expand Down
Loading