Clear the minimized state on the Qt window if the SDL window is not minimized

This commit is contained in:
Cameron Gutman 2024-04-07 00:42:51 -05:00
parent c6710f93dc
commit 6a85996b4a

View file

@ -2190,9 +2190,21 @@ DispatchDeferredCleanup:
// in a larger window, but they don't necessarily want the UI in such // in a larger window, but they don't necessarily want the UI in such
// a large window. // a large window.
if (!m_IsFullScreen && m_QtWindow != nullptr && m_Window != nullptr) { if (!m_IsFullScreen && m_QtWindow != nullptr && m_Window != nullptr) {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
if (SDL_GetWindowFlags(m_Window) & SDL_WINDOW_MINIMIZED) {
m_QtWindow->setWindowStates(m_QtWindow->windowStates() | Qt::WindowMinimized);
}
else if (m_QtWindow->windowStates() & Qt::WindowMinimized) {
m_QtWindow->setWindowStates(m_QtWindow->windowStates() & ~Qt::WindowMinimized);
}
#else
if (SDL_GetWindowFlags(m_Window) & SDL_WINDOW_MINIMIZED) { if (SDL_GetWindowFlags(m_Window) & SDL_WINDOW_MINIMIZED) {
m_QtWindow->setWindowState(Qt::WindowMinimized); m_QtWindow->setWindowState(Qt::WindowMinimized);
} }
else if (m_QtWindow->windowState() & Qt::WindowMinimized) {
m_QtWindow->setWindowState(Qt::WindowNoState);
}
#endif
} }
// This must be called after the decoder is deleted, because // This must be called after the decoder is deleted, because