[Bug 60037] New: Regression: fixed resolution 4:3 fullscreen apps on Wayland have their content offset and present some undefined padding area
http://bugs.winehq.org/show_bug.cgi?id=60037 Bug ID: 60037 Summary: Regression: fixed resolution 4:3 fullscreen apps on Wayland have their content offset and present some undefined padding area Product: Wine Version: 11.13 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winewayland Assignee: wine-bugs@list.winehq.org Reporter: salyigergo94@gmail.com Target Milestone: --- Distribution: --- Some if not all (old, mostly DX8 era) Windows apps which can only render a fullscreen, fixed resolution and different-from-monitor aspect ratio window show problems for me on Wayland with Wine 11.13. For example a fixed 4:3 640x480 or 800x600 fullscreen game running on Wine with Wayland on a 16:9 1920x1080 monitor. These fullscreen 4:3 apps on a 16:9 monitor now have their content offset to the right and an undefined, not-necessarily-black-cleared (sometimes black or white) padding area / bar getting presented on the left of their fullscreen window. This is consistent for me across all Sway, Hyprland and KDE plasma Wayland compositors and with using both stock Wine and DXVK overrides for DirectX DLLs. I did some testing with a build from current master branch (e8781e7c8d07, 2026-07-17). Screenshots of 2 affected games - Touhou 6 running a 640x480 window and Knights and Merchants running a 800x600 window - on Sway in a 1920x1080 monitor will be attched. Sway centers the different aspect ratio fullscreen window and pads the left and right with a black bar (this is normal). The bug is that white bar that is starting from there inside the content area. Then the content being offset to the right I think overflows the centered viewport extends up to the right edge of the screen. 2 more screenshots with the windows popped to floating state will also be attached. The logs with WINEDEBUG="fixme+all,trace+win,trace+waylanddrv" will also be attached (I cut 30k lines from the middle of one log). This is a regression in 11.13, I bisected: Last good commit: eb1cf9f1bcac First bad commit: b868cd31d6b5, 2026-07-01, win32u: Move client surface rect computation out of the drivers The following part is speculative. Noted this part of the logs: 0134:trace:win:client_surface_update_locked ... virtual_rect (0,0)-(640,480), monitor_rect (240,0)-(1680,1080) 0134:trace:waylanddrv:wayland_surface_reconfigure_client ... rect=(240,0)-(1680,1080) I think the problematic padding area is introduced here: dlls/win32u/window.c:326 get_client_surface_rects() { /* ... */ OffsetRect( monitor_rect, monitor_rects.client.left - monitor_rects.visible.left, monitor_rects.client.top - monitor_rects.visible.top ); /* ... */ } **Commenting out that OffsetRect call from get_client_surface_rects fixes the problem for me.** After patching out the OffsetRect call, the windows of these apps look normal, without the offset and the undefined (white or black) padding bar. And the logs now show: 0134:trace:win:client_surface_update_locked ... virtual_rect (0,0)-(640,480), monitor_rect (0,0)-(1440,1080) 0134:trace:waylanddrv:wayland_surface_reconfigure_client ... rect=(0,0)-(1440,1080) But I arguably don't understand what that code does, so I'm just guessing about some things here: 1) if Wine wants to pad a fullscreen different-from-monitor aspect ratio Windows window to the aspect ratio of the monitor, then 1a) it should pad it to the monitor aspect ratio on both sides not just one 1b) and it should ensure that the padding bars are cleared opaque black and not left undefined 2) if Wine does not want to pad these windows but only scale them preserving the different-from-monitor aspect ratio, then 2a) either should not offset its content (monitor_rect ?) 2b) or should crop off the offset with a (missing?) wp_viewport_set_source 2c) or less likely crop off the offset in wl_surface_attach(buf, x, y) with non-zero x or y (?) There are just guesses, this gets way too deep for me here (I touched some other Wayland client code before but not Wine code). I hope some of it is helpful. -- 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=60037 --- Comment #1 from Gergő Sályi <salyigergo94@gmail.com> --- Created attachment 81482 --> http://bugs.winehq.org/attachment.cgi?id=81482 wine commit e8781e7c8d07 on sway running Touhou 6 fullscreen -- 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=60037 --- Comment #2 from Gergő Sályi <salyigergo94@gmail.com> --- Created attachment 81483 --> http://bugs.winehq.org/attachment.cgi?id=81483 wine commit e8781e7c8d07 on sway running Touhou 6 floating -- 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=60037 --- Comment #3 from Gergő Sályi <salyigergo94@gmail.com> --- Created attachment 81484 --> http://bugs.winehq.org/attachment.cgi?id=81484 wine commit e8781e7c8d07 running Touhou 6 log trace+win,trace+waylanddrv -- 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=60037 --- Comment #4 from Gergő Sályi <salyigergo94@gmail.com> --- Created attachment 81485 --> http://bugs.winehq.org/attachment.cgi?id=81485 wine commit e8781e7c8d07 on sway running Knights and Merchants fullscreen -- 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=60037 --- Comment #5 from Gergő Sályi <salyigergo94@gmail.com> --- Created attachment 81486 --> http://bugs.winehq.org/attachment.cgi?id=81486 wine commit e8781e7c8d07 on sway running Knights and Merchants floating -- 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=60037 --- Comment #6 from Gergő Sályi <salyigergo94@gmail.com> --- Created attachment 81487 --> http://bugs.winehq.org/attachment.cgi?id=81487 wine commit e8781e7c8d07 running Knights and Merchants log trace+win,trace+waylanddrv -- 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=60037 Ken Sharp <imwellcushtymelike@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Regression SHA1| |b868cd31d6b5fb0a5e09e45658c | |4901bb6d1c09a CC| |rbernon@codeweavers.com Keywords| |regression Summary|Regression: fixed |Fixed resolution 4:3 |resolution 4:3 fullscreen |fullscreen apps on Wayland |apps on Wayland have their |have their content offset |content offset and present |and present some undefined |some undefined padding area |padding area --- Comment #7 from Ken Sharp <imwellcushtymelike@gmail.com> --- Which apps are affected? -- 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=60037 --- Comment #8 from Gergő Sályi <salyigergo94@gmail.com> ---
Which apps are affected?
This is not app specific. For me all fixed resolution 4:3 games I can find are affected: Already mentioned Knights and Merchants The Peasants Rebellion (2001) and Touhou 6 (custom en patch), but Pharaoh / Pharaoh Cleopatra (1999), Heroes of Might and Magic 3: Complete (1999), Touhou 7 and 8 (custom en patches). I'm trying to give you a vibecoded minimal reproducible example in the attachments: ddraw_mre.c Using DirectX 8 creates a fullscreen 800x600 window, clears it bright red, waits 0.5 sec, recreates the window 640x480, clears the screen light blue. This results in a white bar on the left of the intended light blue cleared window for me. $ i686-w64-mingw32-gcc d3d8_mre.c -o d3d8_mre.exe -ld3d8 -lgdi32 -luser32 $ unset DISPLAY; wine d3d8_mre.exe (Can have it without the 800x600 -> 640x480 recreation too, but then the undefined area is filled with transparency instead of white for me, making it less obvious.) -- 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=60037 --- Comment #9 from Gergő Sályi <salyigergo94@gmail.com> --- Created attachment 81491 --> http://bugs.winehq.org/attachment.cgi?id=81491 Attempt for a vibecoded minimal reproducible example -- 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=60037 --- Comment #10 from Gergő Sályi <salyigergo94@gmail.com> --- correction: minimal reproducible example in the attachments: d3d8_mre.c -- 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=60037 MattM <mowerm@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mowerm@gmail.com --- Comment #11 from MattM <mowerm@gmail.com> --- Created attachment 81581 --> http://bugs.winehq.org/attachment.cgi?id=81581 Window manager behavior in Wine 11.12 vs 11.14 This compilation of screenshots shows what an older Electron app looks like in Wine 11.12 with and without window manager decoration, and Wine 11.14 with and without window manager decoration. Notice the circled mouse pointer. In each case, the mouse is over what it thinks is the "Away" button/link. -- 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=60037 --- Comment #12 from MattM <mowerm@gmail.com> --- I encountered this problem in an older Electron app (private company app, sorry I'm unable to post it here). I was able to bisect down to the exact same commit as Gergő Sályi found: b868cd31d6b5. I'm building and testing on Debian 13. I also found that toggling "Allow the window manager to decorate the window" resulted in a swap of broken vs. working in Wine 11.12 vs 11.14. - Wine 11.12 with "Allow the window manager to decorate the window" = On: Correct rendering and mouse position - Wine 11.12 with "Allow the window manager to decorate the window" = Off: Incorrect rendering, mouse position also incorrect - Wine 11.14 with "Allow the window manager to decorate the window" = On: Incorrect rendering, mouse position also incorrect - Wine 11.14 with "Allow the window manager to decorate the window" = Off: Correct rendering and mouse position These can be seen in my previous comment's attached screenshot. -- 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=60037 --- Comment #13 from MattM <mowerm@gmail.com> --- Created attachment 81583 --> http://bugs.winehq.org/attachment.cgi?id=81583 Wine Electron minimum example Attached is a minimum reproducible example source code for an Electron 13 (yes, old) application. You just need node.js installed and then you can run `npm install` and `npm run build` to produce: dist/wine-offset-example-win32-x64/wine-offset-example.exe . Another note: I'm reproducing this issue on winex11, so I don't know that winewayland is the correct culprit as indicated in the original bug report. -- 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=60037 --- Comment #14 from Gergő Sályi <salyigergo94@gmail.com> --- This got fixed for me with commit b9f8619fd508 (2026-07-30, winewayland: Use the visible rect for toplevel rect.) From my side this issue can be closed, but leaving it open for now so the other issue added by MattM in the comments (which I cannot test for) can also be confirmed resolved by him. -- 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=60037 francesco.zaggia@proton.me changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |francesco.zaggia@proton.me --- Comment #15 from francesco.zaggia@proton.me --- Possibly related to this? https://bugs.winehq.org/show_bug.cgi?id=60002 -- 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=60037 --- Comment #16 from MattM <mowerm@gmail.com> --- Created attachment 81654 --> http://bugs.winehq.org/attachment.cgi?id=81654 Picture of reproduction at 4dbf7bef7a0 Thanks Gergő and Francesco, the issue remains for me with the current master (4dbf7bef7a0). Given that Gergő reports the bug is fixed for this report and the user in 60002 also reports that they can no longer reproduce the issue there, I think it'll be best for me to create a separate report. Apparently, all of us bisecting down to the same culprit (b868cd31d6b5) wasn't a reliable indicator of one thing that needs to be fixed. -- 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=60037 Ken Sharp <imwellcushtymelike@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Fixed by SHA1| |b9f8619fd508993bec03f398cb3 | |fdb90147cfcf8 Resolution|--- |FIXED --- Comment #17 from Ken Sharp <imwellcushtymelike@gmail.com> --- Fixed by b9f8619fd508993bec03f398cb3fdb90147cfcf8 for Wayland. -- 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=60037 Alexandre Julliard <julliard@winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #18 from Alexandre Julliard <julliard@winehq.org> --- Closing bugs fixed in 11.15. -- 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