From 14229b93bad3ca82857564c180abed3f2532df8c Mon Sep 17 00:00:00 2001 From: Rosalie Wanders Date: Sat, 17 Jul 2021 23:43:17 +0200 Subject: [PATCH] Fix Project64 when statusbar is hidden --- .../OpenGLContext/windows/windows_DisplayWindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Graphics/OpenGLContext/windows/windows_DisplayWindow.cpp b/src/Graphics/OpenGLContext/windows/windows_DisplayWindow.cpp index 0e7a1644..c125f272 100644 --- a/src/Graphics/OpenGLContext/windows/windows_DisplayWindow.cpp +++ b/src/Graphics/OpenGLContext/windows/windows_DisplayWindow.cpp @@ -166,6 +166,8 @@ bool DisplayWindowWindows::_resizeWindow() { RECT windowRect, statusRect, toolRect; + windowRect = statusRect = toolRect = { 0 }; + if (m_bFullscreen) { m_screenWidth = config.video.fullscreenWidth; m_screenHeight = config.video.fullscreenHeight; @@ -179,12 +181,12 @@ bool DisplayWindowWindows::_resizeWindow() _setBufferSize(); GetClientRect( hWnd, &windowRect ); - GetWindowRect( hStatusBar, &statusRect ); + + if (hStatusBar) + GetWindowRect( hStatusBar, &statusRect ); if (hToolBar) GetWindowRect( hToolBar, &toolRect ); - else - toolRect.bottom = toolRect.top = 0; m_heightOffset = (statusRect.bottom - statusRect.top); windowRect.right = windowRect.left + config.video.windowedWidth - 1;