mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-12-17 06:33:07 +00:00
Add workaround for macOS fullscreen exit bug
This commit is contained in:
parent
125738f13d
commit
21edcc8113
1 changed files with 12 additions and 0 deletions
|
@ -1073,6 +1073,18 @@ void Session::toggleFullscreen()
|
||||||
// Actually enter/leave fullscreen
|
// Actually enter/leave fullscreen
|
||||||
SDL_SetWindowFullscreen(m_Window, fullScreen ? m_FullScreenFlag : 0);
|
SDL_SetWindowFullscreen(m_Window, fullScreen ? m_FullScreenFlag : 0);
|
||||||
|
|
||||||
|
#ifdef Q_OS_DARWIN
|
||||||
|
// SDL on macOS has a bug that causes the window size to be reset to crazy
|
||||||
|
// large dimensions when exiting out of true fullscreen mode. We can work
|
||||||
|
// around the issue by manually resetting the position and size here.
|
||||||
|
if (!fullScreen && m_FullScreenFlag == SDL_WINDOW_FULLSCREEN) {
|
||||||
|
int x, y, width, height;
|
||||||
|
getWindowDimensions(x, y, width, height);
|
||||||
|
SDL_SetWindowSize(m_Window, width, height);
|
||||||
|
SDL_SetWindowPosition(m_Window, x, y);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Input handler might need to start/stop keyboard grab after changing modes
|
// Input handler might need to start/stop keyboard grab after changing modes
|
||||||
m_InputHandler->updateKeyboardGrabState();
|
m_InputHandler->updateKeyboardGrabState();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue