Skip to content

Commit 6e6e105

Browse files
committed
#3317 Fix full screen issue with Windows 11 24H2
1 parent 89512d4 commit 6e6e105

File tree

4 files changed

+8
-17
lines changed

4 files changed

+8
-17
lines changed

indra/llwindow/llwindow.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ LLWindow::LLWindow(LLWindowCallbacks* callbacks, bool fullscreen, U32 flags)
103103
mFullscreen(fullscreen),
104104
mFullscreenWidth(0),
105105
mFullscreenHeight(0),
106-
mFullscreenBits(0),
107106
mFullscreenRefresh(0),
108107
mSupportedResolutions(NULL),
109108
mNumSupportedResolutions(0),

indra/llwindow/llwindow.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ class LLWindow : public LLInstanceTracker<LLWindow>
223223
bool mFullscreen;
224224
S32 mFullscreenWidth;
225225
S32 mFullscreenHeight;
226-
S32 mFullscreenBits;
227226
S32 mFullscreenRefresh;
228227
LLWindowResolution* mSupportedResolutions;
229228
S32 mNumSupportedResolutions;

indra/llwindow/llwindowwin32.cpp

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -695,8 +695,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
695695
}
696696

697697
if (dev_mode.dmPelsWidth == width &&
698-
dev_mode.dmPelsHeight == height &&
699-
dev_mode.dmBitsPerPel == BITS_PER_PIXEL)
698+
dev_mode.dmPelsHeight == height)
700699
{
701700
success = true;
702701
if ((dev_mode.dmDisplayFrequency - current_refresh)
@@ -736,7 +735,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
736735
// If we found a good resolution, use it.
737736
if (success)
738737
{
739-
success = setDisplayResolution(width, height, BITS_PER_PIXEL, closest_refresh);
738+
success = setDisplayResolution(width, height, closest_refresh);
740739
}
741740

742741
// Keep a copy of the actual current device mode in case we minimize
@@ -749,7 +748,6 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
749748
mFullscreen = true;
750749
mFullscreenWidth = dev_mode.dmPelsWidth;
751750
mFullscreenHeight = dev_mode.dmPelsHeight;
752-
mFullscreenBits = dev_mode.dmBitsPerPel;
753751
mFullscreenRefresh = dev_mode.dmDisplayFrequency;
754752

755753
LL_INFOS("Window") << "Running at " << dev_mode.dmPelsWidth
@@ -763,7 +761,6 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
763761
mFullscreen = false;
764762
mFullscreenWidth = -1;
765763
mFullscreenHeight = -1;
766-
mFullscreenBits = -1;
767764
mFullscreenRefresh = -1;
768765

769766
std::map<std::string,std::string> args;
@@ -1185,7 +1182,7 @@ bool LLWindowWin32::switchContext(bool fullscreen, const LLCoordScreen& size, bo
11851182
// If we found a good resolution, use it.
11861183
if (success)
11871184
{
1188-
success = setDisplayResolution(width, height, BITS_PER_PIXEL, closest_refresh);
1185+
success = setDisplayResolution(width, height, closest_refresh);
11891186
}
11901187

11911188
// Keep a copy of the actual current device mode in case we minimize
@@ -1197,7 +1194,6 @@ bool LLWindowWin32::switchContext(bool fullscreen, const LLCoordScreen& size, bo
11971194
mFullscreen = true;
11981195
mFullscreenWidth = dev_mode.dmPelsWidth;
11991196
mFullscreenHeight = dev_mode.dmPelsHeight;
1200-
mFullscreenBits = dev_mode.dmBitsPerPel;
12011197
mFullscreenRefresh = dev_mode.dmDisplayFrequency;
12021198

12031199
LL_INFOS("Window") << "Running at " << dev_mode.dmPelsWidth
@@ -1223,7 +1219,6 @@ bool LLWindowWin32::switchContext(bool fullscreen, const LLCoordScreen& size, bo
12231219
mFullscreen = false;
12241220
mFullscreenWidth = -1;
12251221
mFullscreenHeight = -1;
1226-
mFullscreenBits = -1;
12271222
mFullscreenRefresh = -1;
12281223

12291224
LL_INFOS("Window") << "Unable to run fullscreen at " << width << "x" << height << LL_ENDL;
@@ -3517,7 +3512,7 @@ F32 LLWindowWin32::getPixelAspectRatio()
35173512

35183513
// Change display resolution. Returns true if successful.
35193514
// protected
3520-
bool LLWindowWin32::setDisplayResolution(S32 width, S32 height, S32 bits, S32 refresh)
3515+
bool LLWindowWin32::setDisplayResolution(S32 width, S32 height, S32 refresh)
35213516
{
35223517
DEVMODE dev_mode;
35233518
::ZeroMemory(&dev_mode, sizeof(DEVMODE));
@@ -3529,7 +3524,6 @@ bool LLWindowWin32::setDisplayResolution(S32 width, S32 height, S32 bits, S32 re
35293524
{
35303525
if (dev_mode.dmPelsWidth == width &&
35313526
dev_mode.dmPelsHeight == height &&
3532-
dev_mode.dmBitsPerPel == bits &&
35333527
dev_mode.dmDisplayFrequency == refresh )
35343528
{
35353529
// ...display mode identical, do nothing
@@ -3541,9 +3535,8 @@ bool LLWindowWin32::setDisplayResolution(S32 width, S32 height, S32 bits, S32 re
35413535
dev_mode.dmSize = sizeof(dev_mode);
35423536
dev_mode.dmPelsWidth = width;
35433537
dev_mode.dmPelsHeight = height;
3544-
dev_mode.dmBitsPerPel = bits;
35453538
dev_mode.dmDisplayFrequency = refresh;
3546-
dev_mode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY;
3539+
dev_mode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY;
35473540

35483541
// CDS_FULLSCREEN indicates that this is a temporary change to the device mode.
35493542
LONG cds_result = ChangeDisplaySettings(&dev_mode, CDS_FULLSCREEN);
@@ -3553,7 +3546,7 @@ bool LLWindowWin32::setDisplayResolution(S32 width, S32 height, S32 bits, S32 re
35533546
if (!success)
35543547
{
35553548
LL_WARNS("Window") << "setDisplayResolution failed, "
3556-
<< width << "x" << height << "x" << bits << " @ " << refresh << LL_ENDL;
3549+
<< width << "x" << height << " @ " << refresh << LL_ENDL;
35573550
}
35583551

35593552
return success;
@@ -3564,7 +3557,7 @@ bool LLWindowWin32::setFullscreenResolution()
35643557
{
35653558
if (mFullscreen)
35663559
{
3567-
return setDisplayResolution( mFullscreenWidth, mFullscreenHeight, mFullscreenBits, mFullscreenRefresh);
3560+
return setDisplayResolution( mFullscreenWidth, mFullscreenHeight, mFullscreenRefresh);
35683561
}
35693562
else
35703563
{

indra/llwindow/llwindowwin32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class LLWindowWin32 : public LLWindow
150150
virtual LLSD getNativeKeyData();
151151

152152
// Changes display resolution. Returns true if successful
153-
bool setDisplayResolution(S32 width, S32 height, S32 bits, S32 refresh);
153+
bool setDisplayResolution(S32 width, S32 height, S32 refresh);
154154

155155
// Go back to last fullscreen display resolution.
156156
bool setFullscreenResolution();

0 commit comments

Comments
 (0)