[Bug 60053] New: winex11: RandR scale transform breaks display mode save/restore
http://bugs.winehq.org/show_bug.cgi?id=60053 Bug ID: 60053 Summary: winex11: RandR scale transform breaks display mode save/restore Product: Wine Version: 11.13 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winex11.drv Assignee: wine-bugs@list.winehq.org Reporter: tiempoeterno@gmail.com Target Milestone: --- Distribution: --- Created attachment 81528 --> http://bugs.winehq.org/attachment.cgi?id=81528 Minimal test case (source, mingw) Overview: When the X11 desktop uses fractional display scaling implemented as a RandR CRTC transform (e.g. Cinnamon's 150% setting, or plain xrandr --scale), Wine reports the transformed framebuffer size (here 3424x1926) as the current display mode, but that size is not in the display mode list (which only contains real modes, e.g. 2560x1440). Every attempt to save or restore display settings then fails with DISP_CHANGE_BADMODE (-2). Two visible consequences: - explorer cannot initialize the registry display settings when any prefix starts; - wined3d cannot restore the display mode whenever a DirectDraw exclusive-fullscreen application loses focus (Alt+Tab), and the app sometimes hangs (its message loop stops) with the desktop left at the game's resolution. Steps to Reproduce: 1) On a 2560x1440 panel, enable fractional scaling as a RandR transform. Without any desktop environment this reproduces it: xrandr --output eDP-1-1 --mode 2560x1440 --scale 1.337494x1.337494 (framebuffer becomes 3424x1926) 2) Create a fresh prefix: WINEPREFIX=/tmp/testprefix wineboot -u 3) Compile the attached sysmenu_storm2.c: i686-w64-mingw32-gcc -O2 -mwindows -o sysmenu_storm2.exe sysmenu_storm2.c (~90 lines: DirectDraw SetCooperativeLevel(EXCLUSIVE|FULLSCREEN) + SetDisplayMode(800x600x16) + primary surface + message loop.) Run it in that prefix, Alt+Tab away, wait a few seconds, Alt+Tab back, exit with Escape. Actual Results: At step 2, on every fresh prefix: err:system:NtUserChangeDisplaySettings Changing L"\\\\.\\DISPLAY1" display settings returned -2. err:explorer:initialize_display_settings Failed to initialize registry display settings for L"\\\\.\\DISPLAY1". At step 3, on every focus loss: err:d3d:wined3d_restore_display_modes Failed to restore all outputs to their registry display settings, error -2. err:d3d:wined3d_swapchain_activate Failed to restore display modes, hr 0x8876086a. Intermittently (race), after Alt+Tab the app's message loop freezes for good and the desktop is left at 800x600. Expected Results: Host display scaling should be transparent to Wine: no errors at prefix creation, and the display mode restored on focus loss — exactly what happens with scaling at 100%. Control experiment: same day, same machine, same binaries, same automated Alt+Tab, with the transform disabled (xrandr --scale 1x1): zero display errors in both step 2 and step 3. Re-enabling the transform brings them back. 100% reproducible. Logs of both configurations attached. Build Date & Hardware: wine-11.13 (WineHQ wine-devel packages), 64-bit prefixes. Linux Mint, kernel 6.17, Cinnamon (muffin WM), X11 session. Hybrid laptop Intel + NVIDIA RTX 3080 Laptop (NVIDIA drives the panel), driver 595.71.05. XRandR 1.6; Wine uses its XRandR 1.4 code path (the "broken NVIDIA RandR" fallback does not trigger: the panel exposes several real resolutions). Additional Builds and Platforms: Also occurs, identically, with current git master (wine-11.13-165-g5bb70f23d1) built from source (logs attached). Does not occur with 100% scaling on the same setup. Windows note: not directly comparable — the trigger is host-side X11 configuration; on Windows, display (DPI) scaling never alters the display mode list, so the current mode is always enumerable. Additional Information: Analysis (from reading the source, wine-11.13/master): with a CRTC transform active, xrandr14_get_current_mode() (dlls/winex11.drv/xrandr.c) fills dmPelsWidth/dmPelsHeight from crtc_info->width/height, which are the transformed dimensions (3424x1926), while the mode list built by xrandr14_get_modes() only contains real modes. find_display_mode() (dlls/win32u/sysparams.c) therefore finds no match for the current mode, source_get_full_mode() fails, and NtUserChangeDisplaySettings() returns DISP_CHANGE_BADMODE. This makes the current mode permanently unrepresentable: explorer cannot save it at prefix init, and wined3d_restore_display_modes() fails on every swapchain activation. Possibly related reports (same fractional-scaling family, different symptoms; none is this bug): bug 58625, bug 50442, bug 58537. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60053 --- Comment #1 from Sly Lem <tiempoeterno@gmail.com> --- Created attachment 81529 --> http://bugs.winehq.org/attachment.cgi?id=81529 Fresh prefix boot, transform active, wine-11.13 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60053 --- Comment #2 from Sly Lem <tiempoeterno@gmail.com> --- Created attachment 81530 --> http://bugs.winehq.org/attachment.cgi?id=81530 Fresh prefix boot, 100% scaling (control) -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60053 --- Comment #3 from Sly Lem <tiempoeterno@gmail.com> --- Created attachment 81531 --> http://bugs.winehq.org/attachment.cgi?id=81531 Test run stderr, transform active, wine-11.13 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60053 --- Comment #4 from Sly Lem <tiempoeterno@gmail.com> --- Created attachment 81532 --> http://bugs.winehq.org/attachment.cgi?id=81532 Test run stderr, 100% scaling (control) -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60053 --- Comment #5 from Sly Lem <tiempoeterno@gmail.com> --- Created attachment 81533 --> http://bugs.winehq.org/attachment.cgi?id=81533 Fresh prefix boot, transform active, git master -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60053 --- Comment #6 from Sly Lem <tiempoeterno@gmail.com> --- Created attachment 81534 --> http://bugs.winehq.org/attachment.cgi?id=81534 Test run stderr, transform active, git master -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla