Fix file dialog

This commit is contained in:
pleb
2026-08-02 20:33:10 -07:00
parent 0773d78621
commit 4dd8e7934f
3 changed files with 13 additions and 23 deletions
+3 -7
View File
@@ -23,15 +23,11 @@ nix run git+https://git.plebsaber.stream/arrowvortex-wine
- Nix with flakes enabled (`experimental-features = nix-command flakes`).
Wine and GUI dependencies come from nixpkgs; you need a working display (X11 or Wayland) for the editor window.
Wine and GUI dependencies come from nixpkgs; you need a working display (X11 or Wayland) for the editor window. The packaged Wine 11.0 launcher has been verified on KDE Plasma Wayland: **File → Open** opens Wine's `Open file` dialog.
## Debugging
Replace `-all` with focused Wine channels around dialogs, shell integration, and file APIs:
```nix
--set WINEDEBUG "+timestamp,+pid,+tid,+seh,+dialog,+commdlg,+shell,+ole,+file,+loaddll"
```
The launcher defaults to quiet Wine logging, but respects `WINEDEBUG` when you set it. Use focused channels around dialogs, shell integration, and file APIs:
Most useful pieces:
@@ -54,4 +50,4 @@ If that is too noisy, start with:
```bash
WINEDEBUG=+x11drv,+wayland,+commdlg
```
```
+1 -1
View File
@@ -36,7 +36,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
$out/share/icons/hicolor/128x128/apps/arrowvortex.png
makeWrapper ${lib.getExe winePkg} $out/bin/arrowvortex \
--set WINEDEBUG "-all" \
--set-default WINEDEBUG "-all" \
--set WINEARCH "win64" \
--run 'export WINEPREFIX="''${WINEPREFIX:-''${XDG_DATA_HOME:-''$HOME/.local/share}/arrowvortex/wine}"' \
--run 'mkdir -p "''$WINEPREFIX"' \
+9 -15
View File
@@ -1,19 +1,13 @@
# Wine on KDE Plasma Wayland
ArrowVortexs **File → Open** dialog does not appear when the Windows build is run under Wine on KDE Plasma with a Wayland session. `WINEDEBUG` traces on `commdlg` showed `GetOpenFileNameW` being entered with plausible flags and `COMDLG32_SetCommDlgExtendedError(0)` cleared, but no usable dialog followed—consistent with Wines graphics stack (notably **winewayland**) failing to host the legacy common-file-dialog UI on this compositor. We tried **unsetting `WAYLAND_DISPLAY`** in the launcher so Wine would prefer Xwayland; that did not fix it for us. We searched **nixpkgs** for similar Wine workarounds and found no comparable pattern (only unrelated apps, e.g. Qt wrappers forcing X11). In the package we then added a **one-shot `wine reg add`** to set `HKCU\Software\Wine\Drivers``Graphics` = `x11` (pin **winex11.drv**), plus `WINEDLLOVERRIDES` to skip Mono/Gecko prompts, and stepped the Wine build through **`wineWow64Packages.stagingFull`** and **`unstableFull`**. None of that produced a reliable File → Open on Plasma Wayland here, so this path is abandoned for now; anyone retrying later should use a **fresh `WINEPREFIX`** after changing Wine version or registry forcing, and may want to log with `WINEDEBUG=+x11drv,+wayland,+commdlg` to see which driver actually loads.
With the flake's current `wineWow64Packages.stableFull` (Wine 11.0), ArrowVortex's **File → Open** dialog works on KDE Plasma Wayland. A fresh prefix was tested by clicking **File → Open**; Wine created a visible `Open file` window and its standard file-list, filename, filter, Open, and Cancel controls.
The app currently uses Wine's X11 driver in this session, even with `WAYLAND_DISPLAY` present. Do not force a graphics driver or unset `WAYLAND_DISPLAY`: both are unnecessary and make troubleshooting harder.
For a regression check, use a fresh prefix and retain the common-dialog trace:
```bash
WINEPREFIX="$(mktemp -d)" WINEDEBUG=+commdlg,+dialog,+x11drv arrowvortex
```
0024:trace:ole:CoRegisterInitializeSpy 00007FFFFE276FD0, 00007FFFFE276FE0
0024:trace:ole:CoInitializeEx 0000000000000000, 0x2
0024:trace:ole:CoInitializeEx Initializing the COM libraries
0024:trace:ole:apartment_construct creating new apartment, model 2
0024:trace:ole:apartment_construct Created apartment on OXID 2000000024
0024:trace:ole:apartment_get_or_create Created main-threaded apartment with OXID 2000000024
0024:trace:commdlg:GetOpenFileNameW flags 0x00001000
0024:trace:commdlg:COMDLG32_SetCommDlgExtendedError (00000000)
0024:trace:shell:SHFree 0000000000000000
0024:trace:shell:SHFree 0000000000000000
0024:trace:shell:SHFree 0000000000000000
0024:trace:shell:SHFree 0000000000000000
0024:trace:shell:SHFree 0000000000000000
```
Then choose **File → Open**. The log should contain `GetOpenFileNameW` and `DIALOG_ParseTemplate32 ... CAPTION L"Open"`.