[Bug 59180] New: DirectDraw fullscreen windows are invisible
http://bugs.winehq.org/show_bug.cgi?id=59180 Bug ID: 59180 Summary: DirectDraw fullscreen windows are invisible Product: Wine Version: 11.0-rc3 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winex11.drv Assignee: wine-bugs@list.winehq.org Reporter: baskanov@gmail.com Distribution: --- DirectDraw apps become invisible after changing the display mode. Reproducible in e.g. Commandos 2 - Men of Courage (GOG), Earth 2150 - Escape from the Blue Planet (GOG) and many others. Bisect points to the following commit: commit 3bea06b80dd21d6ceb6afd44d25dc5d3fde4ff5c winex11.drv: Fix xinerama_get_fullscreen_monitors() not working correctly with non-fullscreen rects. Reverting it on top of the current master fixes the issue. Ubuntu 24.04.3 LTS X.Org version: 21.1.11 KWin version: 5.27.11 -- 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=59180 Anton Baskanov <baskanov@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |baskanov@gmail.com Regression SHA1| |3bea06b80dd21d6ceb6afd44d25 | |dc5d3fde4ff5c Keywords| |regression -- 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=59180 Alexis Murzeau <amubtdx@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amubtdx@gmail.com --- Comment #1 from Alexis Murzeau <amubtdx@gmail.com> --- Hi, I also have the same issue using fresh Wine prefix since wine version 10.19 (which introduced commit 3bea06b80dd21d6ceb6afd44d25dc5d3fde4ff5c). Reproducible in many games when the game resolution is not the native display resolution, including Fable The Lost Chapters, Trackmania Nation Forever, GTA San Andreas, Thief 2, ... I've tried to revert 3bea06b80dd21d6ceb6afd44d25dc5d3fde4ff5c and it fixes the issue for me too. The issue is caused by the removal of this code in xinerama_get_fullscreen_monitors: ``` if (nb_monitors == 1) { memset( indices, 0, sizeof(*indices) * 4 ); *generation = xinerama_generation; goto done; } ``` When changing resolution and without this special condition, xinerama_get_fullscreen_monitors returns -1 with indices set to -1. Previously, with a single monitor (which is my case), indices were set to 0. This issue doesn't seem to be related to window_update_client_config has whether the indices returned are 0 or -1, they are the same before and after the offending commit, which doesn't change resulting behavior of window_update_client_config. But xinerama_get_fullscreen_monitors is also called elsewhere, by the function update_net_wm_fullscreen_monitors. When using WINEDEBUG=x11drv, with additional logs in xinerama_get_fullscreen_monitors and with the commit applied, I get this when the game changes the screen resolution while going fullscreen: ``` 0130:trace:x11drv:X11DRV_WindowPosChanging hwnd 0x7006e, swp_flags 0x181f, shaped 0, rects { window (0,0)-(1024,768), client (0,0)-(1024,768), visible (0,0)-(1024,768) } 0130:trace:x11drv:X11DRV_WindowPosChanged win 0x7006e/6a0001f new_rects { window (0,0)-(1024,768), client (0,0)-(1024,768), visible (0,0)-(1024,768) } style 14000000 flags 8000181f xinerama_get_fullscreen_monitors: window_rect: 0, 0, 1024, 768, nb_monitors: 1 xinerama_get_fullscreen_monitors: window_rect NOT inside monitor_rect 0: 0, 0, 1920, 1080 xinerama_get_fullscreen_monitors: resulting indices: -1, -1, -1, -1, ret = 0 0130:trace:x11drv:update_net_wm_fullscreen_monitors window 0x7006e/6a0001f, requesting _NET_WM_FULLSCREEN_MONITORS -1,-1,-1,-1 serial 1051 ``` I guess _NET_WM_FULLSCREEN_MONITORS with monitor -1 is causing the issue. Inside update_net_wm_fullscreen_monitors, overwriting the indices returned by xinerama_get_fullscreen_monitors to 0 instead of -1 makes the game window to be displayed and everything works. I've tried a patch that instead of reverting commit 3bea06b80dd21d6ceb6afd44d25dc5d3fde4ff5c, adds a call to query_screens() in xinerama_get_fullscreen_monitors. This fixes the issue as the monitor resolution is properly updated to the new resolution and now match the window size which makes xinerama_get_fullscreen_monitors returns indices set to 0 again. I'm not sure this is the way to go, this might cause performance regression, or maybe it is already expected that monitors resolution should be updated. I will attach a log output of xrandr, event, x11drv and additional custom logs that will contains related logs. Additional software and hardware information: Operating System: Debian GNU/Linux 13 KDE Plasma Version: 6.5.4 KDE Frameworks Version: 6.20.0 Qt Version: 6.9.2 Kernel Version: 6.17.13+deb14-amd64 (64-bit) Graphics Platform: X11 Processors: 16 × AMD Ryzen 7 9800X3D 8-Core Processor Memory: 32 Gio of RAM (30.5 Gio usable) Graphics Processor 1: AMD Radeon RX 9070 XT Graphics Processor 2: AMD Ryzen 7 9800X3D 8-Core Processor -- 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=59180 --- Comment #2 from Alexis Murzeau <amubtdx@gmail.com> --- Created attachment 80045 --> http://bugs.winehq.org/attachment.cgi?id=80045 patch adding query_screens call to xinerama_get_fullscreen_monitors and logs of xrandr, events and x11drv Add attachment with: - Patch to add logs - Patch to add query_screens() call in xinerama_get_fullscreen_monitors() which fixes the issue for me. - Wine output logs of "WINEDEBUG=event,xrandr,x11drv wine Fable.exe" with modified wine 11.0-rc3 + above patches. I've used Fable here, but other games exhibit the same behavior and are fixed the same way by this "query_screen()" call. -- 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=59180 --- Comment #3 from Alexis Murzeau <amubtdx@gmail.com> --- Created attachment 80048 --> http://bugs.winehq.org/attachment.cgi?id=80048 issue reproduction with patch adding logs and logs of xrandr, events and x11drv Add attachment with: - Patch to add logs - Wine output logs of "WINEDEBUG=event,xrandr,x11drv wine Fable.exe" with modified wine 11.0-rc3 + above patch. This is reproducing the issue for me, with just additional logs, where the screen resolution is changed to 1024x768, but the game window isn't displayed on the screen (instead there is whatever desktop window was open before running the game). It seems the process PID handling XRandR events (and updating "monitors" variable and the process calling xinerama_get_fullscreen_monitors() is not the same (filtered part of fable_execution_no_display_with_logs_xrandr_events_x11drv.log): ``` 0078:trace:xrandr:xrandr14_device_change_handler xrandr event 0078:trace:xrandr:xrandr14_device_change_handler xrandr event, new rect: 0 0 1024 768 0078:trace:x11drv:query_screens query_screens 0078:trace:x11drv:query_screens query_screens: monitor 0 rect: 0 0 1024 768 0130:trace:x11drv:xinerama_get_fullscreen_monitors xinerama_get_fullscreen_monitors: window_rect: 0, 0, 1024, 768, nb_monitors: 1 0130:trace:x11drv:xinerama_get_fullscreen_monitors xinerama_get_fullscreen_monitors: window_rect NOT inside monitor_rect 0: 0, 0, 1920, 1080 0130:trace:x11drv:xinerama_get_fullscreen_monitors xinerama_get_fullscreen_monitors: resulting indices: -1, -1, -1, -1, ret = 0 0130:trace:x11drv:update_net_wm_fullscreen_monitors window 0x7006e/6e0001f, requesting _NET_WM_FULLSCREEN_MONITORS -1,-1,-1,-1 serial 1051 ``` Which would explain why xinerama_get_fullscreen_monitors() use older screen resolution information. But I'm not sure what would need to be done to fix that properly, I don't know wine enough to analyze the issue further. -- 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=59180 Zhiyi Zhang <zzhang@codeweavers.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zzhang@codeweavers.com --- Comment #4 from Zhiyi Zhang <zzhang@codeweavers.com> --- Looking into this. -- 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=59180 Zhiyi Zhang <zzhang@codeweavers.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|wine-bugs@list.winehq.org |zzhang@codeweavers.com -- 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=59180 Zhiyi Zhang <zzhang@codeweavers.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Assignee|zzhang@codeweavers.com |wine-bugs@list.winehq.org --- Comment #5 from Zhiyi Zhang <zzhang@codeweavers.com> --- Confirmed. I sent https://gitlab.winehq.org/wine/wine/-/merge_requests/9841 that should fix the bug. -- 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=59180 Zhiyi Zhang <zzhang@codeweavers.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |97033f3faa3eda73a34f7768961 | |0a20243c747b6 Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #6 from Zhiyi Zhang <zzhang@codeweavers.com> --- Fixed by 97033f3faa3eda73a34f77689610a20243c747b6 -- 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=59180 Alexandre Julliard <julliard@winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #7 from Alexandre Julliard <julliard@winehq.org> --- Closing bugs fixed in 11.0-rc5. -- 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