Skip to content

Commit

Permalink
Don't set bit mode on sysmenu
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Oct 1, 2023
1 parent 3abc22d commit 74a84d0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Dllmain/BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 6851
#define BUILD_NUMBER 6852
32 changes: 16 additions & 16 deletions GDI/User32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,28 +122,28 @@ int WINAPI user_GetSystemMetrics(int nIndex)

static GetSystemMetricsProc m_pGetSystemMetrics = (Wrapper::ValidProcAddress(GetSystemMetrics_out)) ? (GetSystemMetricsProc)GetSystemMetrics_out : nullptr;

if (nIndex == SM_CXSCREEN)
if (nIndex == SM_CXSCREEN)
{
int Width = GetDDrawWidth();
if (Width)
{
int Width = GetDDrawWidth();
if (Width)
{
return Width;
}
return Width;
}
}

if (nIndex == SM_CYSCREEN)
if (nIndex == SM_CYSCREEN)
{
int Height = GetDDrawHeight();
if (Height)
{
int Height = GetDDrawHeight();
if (Height)
{
return Height;
}
return Height;
}
}

if (!m_pGetSystemMetrics)
{
return 0;
}
if (!m_pGetSystemMetrics)
{
return 0;
}

return m_pGetSystemMetrics(nIndex);
}
18 changes: 9 additions & 9 deletions ddraw/IDirectDrawX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4090,20 +4090,20 @@ HRESULT m_IDirectDrawX::Present(RECT* pSourceRect, RECT* pDestRect)

DWORD GetDDrawBitsPixel(HWND hWnd)
{
if (Config.DdrawOverrideBitMode)
bool isMenu = false;
if (hWnd)
{
return Config.DdrawOverrideBitMode;
char name[256] = {};
GetClassNameA(hWnd, name, sizeof(name));
isMenu = ((DWORD)hWnd == 0x00010010 || strcmp(name, "#32769") == S_OK);
}
if (DDrawVector.size() && DisplayMode.hWnd)
if (!isMenu)
{
bool isMenu = false;
if (hWnd)
if (Config.DdrawOverrideBitMode)
{
char name[256] = {};
GetClassNameA(hWnd, name, sizeof(name));
isMenu = ((DWORD)hWnd == 0x00010010 || strcmp(name, "#32769") == S_OK);
return Config.DdrawOverrideBitMode;
}
if (!isMenu)
if (DDrawVector.size() && DisplayMode.hWnd)
{
return Exclusive.BPP ? Exclusive.BPP : DisplayMode.BPP;
}
Expand Down

0 comments on commit 74a84d0

Please sign in to comment.