Skip to content

Commit 1aa78ab

Browse files
rbernonivyl
authored andcommitted
HACK: win32u: Move AdjustWindowRect hack to only apply to syscall.
Similar to how it was done in Proton 9, we only hacked the version that was in user32. CW-Bug-Id: #25938
1 parent 2ac58dd commit 1aa78ab

3 files changed

Lines changed: 16 additions & 15 deletions

File tree

dlls/win32u/defwnd.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -258,20 +258,6 @@ BOOL adjust_window_rect( RECT *rect, DWORD style, BOOL menu, DWORD ex_style, UIN
258258
NONCLIENTMETRICSW ncm = {.cbSize = sizeof(ncm)};
259259
int adjust = 0;
260260

261-
if (user_driver->pHasWindowManager( "steamcompmgr" ))
262-
{
263-
/* Disable gamescope undecorated windows hack for following games. They don't expect client
264-
* rect equals to window rect when in windowed mode. */
265-
const char *sgi = getenv( "SteamGameId" );
266-
if (
267-
!((style & WS_POPUP) && (ex_style & WS_EX_TOOLWINDOW)) /* Bug 20038: game splash screens */
268-
&& !(sgi && !strcmp( sgi, "2563800" )) /* Bug 23342: The Last Game */
269-
&& !(sgi && !strcmp( sgi, "1240440" )) /* Bug 23802: Halo Infinite */
270-
&& !(sgi && !strcmp( sgi, "613830" )) /* Bug 25747: CHRONO TRIGGER */
271-
)
272-
return TRUE;
273-
}
274-
275261
NtUserSystemParametersInfoForDpi( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0, dpi );
276262

277263
if ((ex_style & (WS_EX_STATICEDGE|WS_EX_DLGMODALFRAME)) == WS_EX_STATICEDGE)

dlls/win32u/sysparams.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7362,6 +7362,21 @@ ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code
73627362
case NtUserCallTwoParam_AdjustWindowRect:
73637363
{
73647364
struct adjust_window_rect_params *params = (void *)arg2;
7365+
7366+
if (user_driver->pHasWindowManager( "steamcompmgr" ))
7367+
{
7368+
/* Disable gamescope undecorated windows hack for following games. They don't expect client
7369+
* rect equals to window rect when in windowed mode. */
7370+
const char *sgi = getenv( "SteamGameId" );
7371+
if (
7372+
!((params->style & WS_POPUP) && (params->ex_style & WS_EX_TOOLWINDOW)) /* Bug 20038: game splash screens */
7373+
&& !(sgi && !strcmp( sgi, "2563800" )) /* Bug 23342: The Last Game */
7374+
&& !(sgi && !strcmp( sgi, "1240440" )) /* Bug 23802: Halo Infinite */
7375+
&& !(sgi && !strcmp( sgi, "613830" )) /* Bug 25747: CHRONO TRIGGER */
7376+
)
7377+
return TRUE;
7378+
}
7379+
73657380
return adjust_window_rect( (RECT *)arg1, params->style, params->menu, params->ex_style, params->dpi );
73667381
}
73677382

dlls/win32u/window.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1907,7 +1907,7 @@ static RECT get_visible_rect( HWND hwnd, BOOL shaped, UINT style, UINT ex_style,
19071907

19081908
if (IsRectEmpty( &rects->window ) || EqualRect( &rects->window, &rects->client ) || shaped || !decorated_mode) return rects->window;
19091909
if (!user_driver->pGetWindowStyleMasks( hwnd, style, ex_style, &style_mask, &ex_style_mask )) return rects->window;
1910-
if (!NtUserAdjustWindowRect( &rect, style & style_mask, FALSE, ex_style & ex_style_mask, dpi )) return rects->window;
1910+
if (!adjust_window_rect( &rect, style & style_mask, FALSE, ex_style & ex_style_mask, dpi )) return rects->window;
19111911

19121912
visible_rect = rects->window;
19131913
visible_rect.left -= rect.left;

0 commit comments

Comments
 (0)