https://bugs.winehq.org/show_bug.cgi?id=56285
Bug ID: 56285 Summary: Scaling on screen is wrong with Wine Wayland driver while resolution detected is correct. Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: skokkineas@protonmail.com Distribution: ---
As you can see in my attachment I have the FF XV Benchmark running in fullscreen.
My laptop has two screens, the top one has a resolution of 2560x1600 (which is correctly detected by the Wayland driver). The bottom one is a resolution of 2560x1100.
On X11 the image is scaled properly on the top screen but the detected resolution is wrong (it detects the top screen as 3840x1400).
Specs:
Laptop: Asus Zephyrus Duo 2023 CPU: 7945HX GPU: 4090M RAM: 32 GBs DDR5 Driver: NVK Distro: Garuda Linux Wine Version: wine-9.1-73-ge607da943aa (Staging) DE: Plasma 6 with Apps Scaled By The System selected. (Same happens with Apps Scaled By Themselves as well - also on Plasma 5)
https://bugs.winehq.org/show_bug.cgi?id=56285
--- Comment #1 from Stavros Kokkineas skokkineas@protonmail.com --- Created attachment 76007 --> https://bugs.winehq.org/attachment.cgi?id=76007 Scaling by Wayland Driver
https://bugs.winehq.org/show_bug.cgi?id=56285
Zeb Figura z.figura12@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |9.1 Component|-unknown |winewayland
https://bugs.winehq.org/show_bug.cgi?id=56285
alexandros.frantzis@collabora.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |alexandros.frantzis@collabo | |ra.com
--- Comment #2 from alexandros.frantzis@collabora.com --- If the screen is scaled then, at the moment, you will need to manually apply the same scale factor in Wine for fullscreen to work properly (winecfg -> Graphics -> Screen resolution). 1x is 96dpi so 2x => 192dpi, 1.5x => 144dpi etc.
Let me know if this fixes things for you.
https://bugs.winehq.org/show_bug.cgi?id=56285
--- Comment #3 from Stavros Kokkineas skokkineas@protonmail.com --- (In reply to alexandros.frantzis from comment #2)
If the screen is scaled then, at the moment, you will need to manually apply the same scale factor in Wine for fullscreen to work properly (winecfg -> Graphics -> Screen resolution). 1x is 96dpi so 2x => 192dpi, 1.5x => 144dpi etc.
Let me know if this fixes things for you.
Yes, setting it to 144 DPI on my 2560x1600 screen fixed it. Thanx! :)
http://bugs.winehq.org/show_bug.cgi?id=56285
garrett m garrettm4@protonmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |garrettm4@protonmail.com
--- Comment #4 from garrett m garrettm4@protonmail.com --- Changing the winecfg DPI to match the DE's display scale works for games with resolutions less than the native display resolution. For example, a 4k display with 200% scaling would use double 96dpi or 192dpi in winecfg. However, for games with native resolution equal to the display resolution, the game will select a lower resolution (1920x1080) and be upscaled by Wine to the native display resolution (3840x2160) which is not what we want. Ideally, the Wine Wayland driver needs to avoid scaling any fullscreen app that requests a window size equal to the display resolution. Currently, it will apply the DE's display scale when the fullscreen window size = display resolution and thus overflow the screen. E.g., 200% scaling in GNOME will scale a 4k game window twice as large...
From talking with the Niri DE developer, he said this is a client side viewport issue. When working with full screen apps/games only physical pixel space should be used. Logical pixel space is really only useful for decorated windowed apps with sizes much smaller than fullscreen. For fullscreen apps that have a resolution / window size equal to the display resolution, Wine's Wayland driver should not scale the app and report the display's physical pixel dimensions so the app can scale itself correctly. For a fullscreen app with a resolution / window size less than the display resolution, Wine should scale the app. However, it would be nice to have an environment variable to configure this behavior such as setting integer scaling and the scaling filter used (nearest or bilinear).
http://bugs.winehq.org/show_bug.cgi?id=56285
--- Comment #5 from garrett m garrettm4@protonmail.com --- Thinking about this some more, maybe a new environment variable (WINE_PHYSICAL_PIXEL_SPACE=1) could avoid a lot of logic by ignoring the DE's display scale / Wine's DPI setting, but maybe keep the DPI setting for the cursor, and report physical pixels to the app instead of logical pixels. This would fix older, non-DPI aware games with native resolutions equal to the display resolution. For non-DPI aware games with native resolutions less than the display resolution, everything seems to already work, but it would be nice to have an environment variable to pillar-box fullscreen output and pick the filter for older games / apps. This could also be used for manual scaling of select non-fullscreen apps like old windowed games and XP era (or older) apps too (e.g., WinXP FreeCell).
Say
WINE_APP_WINDOW_UPSCALE=[<n>,<nearest|linear>] WINE_APP_FULLSCREEN_UPSCALE=[<none|fill|aspect|integer>,<nearest|linear>]
where,
MANUAL WINDOW SCALING n - manual scaling factor to apply to windowed app/game (integer value, but maybe fp for fraction scaling)
AUTO FULLSCREEN SCALING BEHAVIOR none - do not scale fullscreen app, center output on screen fill - scale requested window size to fill screen, ignoring aspect ratio aspect - scale requested window size to fill screen, preserving aspect ratio integer - scale requested window size to fill screen using closest integer value
SCALING FILTER nearest - nearest neighbor upscaling filter (useful for old XP/9x apps and games with integer scaling factor) linear - bilinear upscaling filter