diff --git a/CHANGELOG.md b/CHANGELOG.md index e9a926a2..5e5012c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [Unreleased] +### Fixed +- Black screen issues when closing fullscreen window on macOS + ## [2.7.2] - 2024-09-15 ### Fixed - Opening download directory of a torrent with some file managers diff --git a/src/ui/screens/mainwindow/mainwindow.cpp b/src/ui/screens/mainwindow/mainwindow.cpp index d7671b1f..e0557790 100644 --- a/src/ui/screens/mainwindow/mainwindow.cpp +++ b/src/ui/screens/mainwindow/mainwindow.cpp @@ -1486,6 +1486,13 @@ namespace tremotesf { } } debug().log("Hiding {}", *mWindow); + if constexpr (targetOs == TargetOs::UnixMacOS) { + // Hiding window when it's in fullscreen mode can have weird effects on macOS + if (mWindow->isFullScreen()) { + debug().log("Exiting fullscreen"); + mWindow->setWindowState(mWindow->windowState().setFlag(Qt::WindowFullScreen, false)); + } + } mWindow->hide(); if constexpr (targetOs == TargetOs::UnixMacOS) { // We need this so that system menu bar switches to previous app