This is similar to 1529ab0ac7a3591cad301d7b3cbb0a7d85377f3e.
DOOM (379720) doesn't change back to the original resolution when entering windowed mode from non-native fullscreen mode on the secondary monitor. So after that, the raw and effective monitor DPI differs when emulate_modeset is on, and Wine needs to scale the game window according to DPI. Wine's built-in title bar is drawn using NtGdiGradientFill() in draw_caption_bar(). On Linux, NtGdiGradientFill() eventually calls xrenderdrv_GradientFill(). However, the lp_to_dp() in winex11.drv doesn't map coordinates to raw monitor DPI. So the title bar drawn in this case is too small and looks corrupted.
From: Zhiyi Zhang zzhang@codeweavers.com
This is similar to 1529ab0ac7a3591cad301d7b3cbb0a7d85377f3e.
DOOM (379720) doesn't change back to the original resolution when entering windowed mode from non-native fullscreen mode on the secondary monitor. So after that, the raw and effective monitor DPI differs when emulate_modeset is on, and Wine needs to scale the game window according to DPI. Wine's built-in title bar is drawn using NtGdiGradientFill() in draw_caption_bar(). On Linux, NtGdiGradientFill() eventually calls xrenderdrv_GradientFill(). However, the lp_to_dp() in winex11.drv doesn't map coordinates to raw monitor DPI. So the title bar drawn in this case is too small and looks corrupted. --- dlls/win32u/mapping.c | 16 ++++++++++++++++ dlls/winex11.drv/x11drv.h | 2 +- include/ntgdi.h | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/dlls/win32u/mapping.c b/dlls/win32u/mapping.c index 65f276e853f..ec0e7e4415d 100644 --- a/dlls/win32u/mapping.c +++ b/dlls/win32u/mapping.c @@ -247,6 +247,22 @@ BOOL WINAPI NtGdiTransformPoints( HDC hdc, const POINT *points_in, POINT *points ret = TRUE; break;
+ case NtGdiLPtoDPRaw: + for (i = 0; i < count; i++) + { + double x = points_in[i].x; + double y = points_in[i].y; + points_out[i].x = GDI_ROUND( x * dc->xformWorld2Vport.eM11 + + y * dc->xformWorld2Vport.eM21 + + dc->xformWorld2Vport.eDx ); + points_out[i].y = GDI_ROUND( x * dc->xformWorld2Vport.eM12 + + y * dc->xformWorld2Vport.eM22 + + dc->xformWorld2Vport.eDy ); + points_out[i] = map_dpi_point( points_out[i], dc->dpi_from, dc->dpi_to ); + } + ret = TRUE; + break; + default: WARN( "invalid mode %x\n", mode ); break; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index eed34cf1cae..60cbf838ba3 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -893,7 +893,7 @@ extern NTSTATUS x11drv_tablet_info( void *arg );
static inline BOOL lp_to_dp( HDC hdc, POINT *points, INT count ) { - return NtGdiTransformPoints( hdc, points, points, count, NtGdiLPtoDP ); + return NtGdiTransformPoints( hdc, points, points, count, NtGdiLPtoDPRaw ); }
static inline UINT get_palette_entries( HPALETTE palette, UINT start, UINT count, PALETTEENTRY *entries ) diff --git a/include/ntgdi.h b/include/ntgdi.h index c5032cc6970..abc5d44faae 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -110,6 +110,8 @@ enum { NtGdiLPtoDP, NtGdiDPtoLP, + /* not compatible with Windows */ + NtGdiLPtoDPRaw, };
enum
This merge request was closed by Zhiyi Zhang.