https://bugs.winehq.org/show_bug.cgi?id=50968
Bug ID: 50968 Summary: Indiana Jones and the Infernal Machine GOG 1.2: Load/Save Game dialogs don't render correctly Product: Wine Version: 6.6 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: comdlg32 Assignee: wine-bugs@winehq.org Reporter: pokeyprogrammer@yahoo.com Distribution: ---
Created attachment 69798 --> https://bugs.winehq.org/attachment.cgi?id=69798 Console log w/ commdlg,dialog channels enabled + screen shots from Wine 6.6 and Win10
Config: Ubuntu 20.10 linux 5.8.0-48-generic (x86_64) Wine 6.6 (from Ubuntu winehq-devel package) GOG Indiana Jones and the Infernal Machine 1.2 (23840)
Store page: https://www.gog.com/game/indiana_jones_and_the_infernal_machine
Repro steps: 1. Download setup_indiana_jones_and_the_infernal_machine_1.2_(23840).exe from GOG. 2. Run the installer from step (1) in wine. 3. Once the installer is finished, run "$HOME/.wine/drive_c/GOG\ Games/Infernal\ Machine/Jones3D.exe". 4. In the launcher that appears, click the "Resume Play" button. 5. Wait for the "Load Game" dialog to appear.
Reproducibility: always
Notes: - I've attached screenshots of the "Load Game" dialog's appearance running under Wine as well as Win10, in addition to a console log w/ WINEDEBUG=+commdlg,+dialog. - In the "Load Game" dialog, I can use the TAB key to switch between controls even though it's not rendered correctly. If I TAB to the filename box and type in a save game filename, the game does load the file correctly and it's playable. - It looks like the "Jones3D.exe" that we originally launch is launching the real game in "$HOME/.wine/drive_c/GOG\ Games/Infernal\ Machine/Resource/Indy3D.exe" and that the "Load Game" dialog is actually being created from Indy3D.exe rather than Jones3D.exe, but launching Indy3D.exe directly doesn't work. - I have been able to reproduce the same issue in PlayOnMac w/ Wine 4.12.1 (19.0.0-cx) x86on64), and PlayOnLinux w/ Wine 4.12.1, 5.0, and 6.5 as well.
https://bugs.winehq.org/show_bug.cgi?id=50968
pokeyprogrammer@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Distribution|--- |Ubuntu CC| |pokeyprogrammer@yahoo.com URL| |https://www.gog.com/game/in | |diana_jones_and_the_inferna | |l_machine
--- Comment #1 from pokeyprogrammer@yahoo.com --- shasum for the installer is: 0b0ffce72e4853c02e29a880247b65437a1ce0af
https://bugs.winehq.org/show_bug.cgi?id=50968
Jeff Zaroyko jeffz@jeffz.name changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 URL|https://www.gog.com/game/in |https://archive.org/details |diana_jones_and_the_inferna |/IndianaJonesandtheInfernal |l_machine |Machine_1020 Keywords| |download Status|UNCONFIRMED |NEW
--- Comment #2 from Jeff Zaroyko jeffz@jeffz.name --- Confirming the same issue is exhibited by the freely available demo, with wine-6.5 Adding download link and keyword.
https://bugs.winehq.org/show_bug.cgi?id=50968
--- Comment #3 from pokeyprogrammer@yahoo.com --- I dug into the app to figure out what it's doing, and the load dialog that's messed up is calling GetOpenFileNameA() to create an explorer-style load dialog (OFN_EXPLORER) that includes custom child dialog template (OFN_ENABLETEMPLATE) and hook (OFN_ENABLEHOOK). It also uses an older version of the struct (OPENFILENAME_SIZE_VERSION_400) which hides the places bar.
The custom child dialog template uses a static stc32 control to put the controls to the right of the standard controls rather than underneath, and has a few additional controls to display a level preview along with a static "film" icon.
The hook procedure has a bunch of code to set a custom font (Times New Roman) and resize/move controls (both custom and built-in) when handling WM_INITDIALOG and CDN_INITDONE, but I think the crux of the problem is that at the end of CDN_INITDONE, the hook procedure makes a SetWindowPos(hChildDlgWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE) call that places the custom child dialog above the other dialog windows, which prevents them from responding to messages (paint/mouse/etc.).
If I modify the binary to make that SetWindowPos() call set the SWP_NOZORDER flag in addition to the other flags, the dialog appears and behaves correctly (at least as far as I can tell).
I created a stripped-down Visual Studio 2019 project w/o SWP_NOZORDER that reproduces the issue (I will attach this shortly). Under Wine (7.3 is latest tested), I can see that the HWND for the child dialog gets put to the top of the Z order after the SetWindowPos() call. However, Win10 apparently ignores the HWND_TOPMOST flag and leaves the HWND for the child dialog at the bottom of the Z-order.
I suspect this has to do with the remarks about SWP_NOZORDER and HWND_TOPMOST discussed on https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwin..., though the behavior specified by remarks isn't entirely clear to me.
https://bugs.winehq.org/show_bug.cgi?id=50968
--- Comment #4 from pokeyprogrammer@yahoo.com --- Created attachment 71967 --> https://bugs.winehq.org/attachment.cgi?id=71967 Visual Studio 2019 project to reproduce the issue
This is an x64 project that uses Unicode APIs, vs. 32-bit ASCII for the original app.