Skip to content

Commit 7ff7cc3

Browse files
committed
#3317 Fix full screen issue with Windows 11 24H2
1 parent 3839d3d commit 7ff7cc3

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
@@ -104,7 +104,6 @@ LLWindow::LLWindow(LLWindowCallbacks* callbacks, bool fullscreen, U32 flags)
104104
mFullscreen(fullscreen),
105105
mFullscreenWidth(0),
106106
mFullscreenHeight(0),
107-
mFullscreenBits(0),
108107
mFullscreenRefresh(0),
109108
mSupportedResolutions(NULL),
110109
mNumSupportedResolutions(0),

indra/llwindow/llwindow.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ class LLWindow : public LLInstanceTracker<LLWindow>
226226
bool mFullscreen;
227227
S32 mFullscreenWidth;
228228
S32 mFullscreenHeight;
229-
S32 mFullscreenBits;
230229
S32 mFullscreenRefresh;
231230
LLWindowResolution* mSupportedResolutions;
232231
S32 mNumSupportedResolutions;

indra/llwindow/llwindowwin32.cpp

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

692692
if (dev_mode.dmPelsWidth == width &&
693-
dev_mode.dmPelsHeight == height &&
694-
dev_mode.dmBitsPerPel == BITS_PER_PIXEL)
693+
dev_mode.dmPelsHeight == height)
695694
{
696695
success = true;
697696
if ((dev_mode.dmDisplayFrequency - current_refresh)
@@ -731,7 +730,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
731730
// If we found a good resolution, use it.
732731
if (success)
733732
{
734-
success = setDisplayResolution(width, height, BITS_PER_PIXEL, closest_refresh);
733+
success = setDisplayResolution(width, height, closest_refresh);
735734
}
736735

737736
// Keep a copy of the actual current device mode in case we minimize
@@ -744,7 +743,6 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
744743
mFullscreen = true;
745744
mFullscreenWidth = dev_mode.dmPelsWidth;
746745
mFullscreenHeight = dev_mode.dmPelsHeight;
747-
mFullscreenBits = dev_mode.dmBitsPerPel;
748746
mFullscreenRefresh = dev_mode.dmDisplayFrequency;
749747

750748
LL_INFOS("Window") << "Running at " << dev_mode.dmPelsWidth
@@ -758,7 +756,6 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
758756
mFullscreen = false;
759757
mFullscreenWidth = -1;
760758
mFullscreenHeight = -1;
761-
mFullscreenBits = -1;
762759
mFullscreenRefresh = -1;
763760

764761
std::map<std::string,std::string> args;
@@ -1175,7 +1172,7 @@ bool LLWindowWin32::switchContext(bool fullscreen, const LLCoordScreen& size, bo
11751172
// If we found a good resolution, use it.
11761173
if (success)
11771174
{
1178-
success = setDisplayResolution(width, height, BITS_PER_PIXEL, closest_refresh);
1175+
success = setDisplayResolution(width, height, closest_refresh);
11791176
}
11801177

11811178
// Keep a copy of the actual current device mode in case we minimize
@@ -1187,7 +1184,6 @@ bool LLWindowWin32::switchContext(bool fullscreen, const LLCoordScreen& size, bo
11871184
mFullscreen = true;
11881185
mFullscreenWidth = dev_mode.dmPelsWidth;
11891186
mFullscreenHeight = dev_mode.dmPelsHeight;
1190-
mFullscreenBits = dev_mode.dmBitsPerPel;
11911187
mFullscreenRefresh = dev_mode.dmDisplayFrequency;
11921188

11931189
LL_INFOS("Window") << "Running at " << dev_mode.dmPelsWidth
@@ -1213,7 +1209,6 @@ bool LLWindowWin32::switchContext(bool fullscreen, const LLCoordScreen& size, bo
12131209
mFullscreen = false;
12141210
mFullscreenWidth = -1;
12151211
mFullscreenHeight = -1;
1216-
mFullscreenBits = -1;
12171212
mFullscreenRefresh = -1;
12181213

12191214
LL_INFOS("Window") << "Unable to run fullscreen at " << width << "x" << height << LL_ENDL;
@@ -3509,7 +3504,7 @@ F32 LLWindowWin32::getPixelAspectRatio()
35093504

35103505
// Change display resolution. Returns true if successful.
35113506
// protected
3512-
bool LLWindowWin32::setDisplayResolution(S32 width, S32 height, S32 bits, S32 refresh)
3507+
bool LLWindowWin32::setDisplayResolution(S32 width, S32 height, S32 refresh)
35133508
{
35143509
DEVMODE dev_mode;
35153510
::ZeroMemory(&dev_mode, sizeof(DEVMODE));
@@ -3521,7 +3516,6 @@ bool LLWindowWin32::setDisplayResolution(S32 width, S32 height, S32 bits, S32 re
35213516
{
35223517
if (dev_mode.dmPelsWidth == width &&
35233518
dev_mode.dmPelsHeight == height &&
3524-
dev_mode.dmBitsPerPel == bits &&
35253519
dev_mode.dmDisplayFrequency == refresh )
35263520
{
35273521
// ...display mode identical, do nothing
@@ -3533,9 +3527,8 @@ bool LLWindowWin32::setDisplayResolution(S32 width, S32 height, S32 bits, S32 re
35333527
dev_mode.dmSize = sizeof(dev_mode);
35343528
dev_mode.dmPelsWidth = width;
35353529
dev_mode.dmPelsHeight = height;
3536-
dev_mode.dmBitsPerPel = bits;
35373530
dev_mode.dmDisplayFrequency = refresh;
3538-
dev_mode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY;
3531+
dev_mode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY;
35393532

35403533
// CDS_FULLSCREEN indicates that this is a temporary change to the device mode.
35413534
LONG cds_result = ChangeDisplaySettings(&dev_mode, CDS_FULLSCREEN);
@@ -3545,7 +3538,7 @@ bool LLWindowWin32::setDisplayResolution(S32 width, S32 height, S32 bits, S32 re
35453538
if (!success)
35463539
{
35473540
LL_WARNS("Window") << "setDisplayResolution failed, "
3548-
<< width << "x" << height << "x" << bits << " @ " << refresh << LL_ENDL;
3541+
<< width << "x" << height << " @ " << refresh << LL_ENDL;
35493542
}
35503543

35513544
return success;
@@ -3556,7 +3549,7 @@ bool LLWindowWin32::setFullscreenResolution()
35563549
{
35573550
if (mFullscreen)
35583551
{
3559-
return setDisplayResolution( mFullscreenWidth, mFullscreenHeight, mFullscreenBits, mFullscreenRefresh);
3552+
return setDisplayResolution( mFullscreenWidth, mFullscreenHeight, mFullscreenRefresh);
35603553
}
35613554
else
35623555
{

indra/llwindow/llwindowwin32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class LLWindowWin32 : public LLWindow
151151
LLSD getNativeKeyData() const override;
152152

153153
// Changes display resolution. Returns true if successful
154-
bool setDisplayResolution(S32 width, S32 height, S32 bits, S32 refresh);
154+
bool setDisplayResolution(S32 width, S32 height, S32 refresh);
155155

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

0 commit comments

Comments
 (0)