Skip to content

Commit efdb86d

Browse files
Hecklezzakleshchev
authored andcommitted
Fixes fullscreen mode in Windows 11 24H2
1 parent 6e6e105 commit efdb86d

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

indra/newview/llappviewerwin32.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,29 @@ bool LLAppViewerWin32::reportCrashToBugsplat(void* pExcepInfo)
816816
return false;
817817
}
818818

819+
bool LLAppViewerWin32::initWindow()
820+
{
821+
// This is a workaround/hotfix for a change in Windows 11 24H2 (and possibly later)
822+
// Where the window width and height need to correctly reflect an available FullScreen size
823+
if (gSavedSettings.getBOOL("FullScreen"))
824+
{
825+
DEVMODE dev_mode;
826+
::ZeroMemory(&dev_mode, sizeof(DEVMODE));
827+
dev_mode.dmSize = sizeof(DEVMODE);
828+
if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dev_mode))
829+
{
830+
gSavedSettings.setU32("WindowWidth", dev_mode.dmPelsWidth);
831+
gSavedSettings.setU32("WindowHeight", dev_mode.dmPelsHeight);
832+
}
833+
else
834+
{
835+
LL_WARNS("AppInit") << "Unable to set WindowWidth and WindowHeight for FullScreen mode" << LL_ENDL;
836+
}
837+
}
838+
839+
return LLAppViewer::initWindow();
840+
}
841+
819842
void LLAppViewerWin32::initLoggingAndGetLastDuration()
820843
{
821844
LLAppViewer::initLoggingAndGetLastDuration();

indra/newview/llappviewerwin32.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class LLAppViewerWin32 : public LLAppViewer
4646
bool reportCrashToBugsplat(void* pExcepInfo) override;
4747

4848
protected:
49+
bool initWindow() override; // Override to initialize the viewer's window.
4950
void initLoggingAndGetLastDuration() override; // Override to clean stack_trace info.
5051
void initConsole() override; // Initialize OS level debugging console.
5152
bool initHardwareTest() override; // Win32 uses DX9 to test hardware.

0 commit comments

Comments
 (0)