Fix file dialog

This commit is contained in:
pleb
2026-08-02 20:33:10 -07:00
parent 0773d78621
commit 314e3391ce
3 changed files with 19 additions and 25 deletions
+5 -7
View File
@@ -1,6 +1,8 @@
# ArrowVortex (Nix flake) # ArrowVortex (Nix flake)
This flake packages [ArrowVortex](https://github.com/uvcat7/ArrowVortex) from the upstream Windows release zip and runs it with Wine. The default Wine prefix is `$XDG_DATA_HOME/arrowvortex/wine` (or `~/.local/share/arrowvortex/wine` when `XDG_DATA_HOME` is unset). Override with `WINEPREFIX` if you want a different prefix. This flake packages [ArrowVortex](https://github.com/uvcat7/ArrowVortex) from the upstream Windows release zip and runs it with Wine. The default Wine prefix is `$XDG_DATA_HOME/arrowvortex/wine-<wine-version>` (or `~/.local/share/arrowvortex/wine-<wine-version>` when `XDG_DATA_HOME` is unset). Override with `WINEPREFIX` if you want a different prefix.
The versioned prefix deliberately leaves the old unversioned `arrowvortex/wine` prefix alone. It was created by an earlier Wine build and does not reliably show ArrowVortex's native file dialog. The new default starts with a clean compatible prefix; your Windows `Z:` drive still exposes your normal Linux files.
## Run from a local checkout ## Run from a local checkout
@@ -23,15 +25,11 @@ nix run git+https://git.plebsaber.stream/arrowvortex-wine
- Nix with flakes enabled (`experimental-features = nix-command flakes`). - 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 ## Debugging
Replace `-all` with focused Wine channels around dialogs, shell integration, and file APIs: The launcher defaults to quiet Wine logging, but respects `WINEDEBUG` when you set it. Use focused channels around dialogs, shell integration, and file APIs:
```nix
--set WINEDEBUG "+timestamp,+pid,+tid,+seh,+dialog,+commdlg,+shell,+ole,+file,+loaddll"
```
Most useful pieces: Most useful pieces:
+2 -2
View File
@@ -36,9 +36,9 @@ stdenvNoCC.mkDerivation (finalAttrs: {
$out/share/icons/hicolor/128x128/apps/arrowvortex.png $out/share/icons/hicolor/128x128/apps/arrowvortex.png
makeWrapper ${lib.getExe winePkg} $out/bin/arrowvortex \ makeWrapper ${lib.getExe winePkg} $out/bin/arrowvortex \
--set WINEDEBUG "-all" \ --set-default WINEDEBUG "-all" \
--set WINEARCH "win64" \ --set WINEARCH "win64" \
--run 'export WINEPREFIX="''${WINEPREFIX:-''${XDG_DATA_HOME:-''$HOME/.local/share}/arrowvortex/wine}"' \ --run 'export WINEPREFIX="''${WINEPREFIX:-''${XDG_DATA_HOME:-''$HOME/.local/share}/arrowvortex/wine-${winePkg.version}}"' \
--run 'mkdir -p "''$WINEPREFIX"' \ --run 'mkdir -p "''$WINEPREFIX"' \
--chdir "$out/share/arrowvortex" \ --chdir "$out/share/arrowvortex" \
--add-flags "ArrowVortex.exe" --add-flags "ArrowVortex.exe"
+11 -15
View File
@@ -1,19 +1,15 @@
# Wine on KDE Plasma Wayland # 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 with a fresh prefix. `Ctrl+O` was tested directly; Wine created a visible `Open file` window and its standard file-list, filename, filter, Open, and Cancel controls.
An existing prefix created by an earlier Wine build reproduced the failure even after the old graphics-driver registry override was removed. The launcher therefore defaults to a Wine-versioned prefix. It does not modify an existing prefix; explicitly setting `WINEPREFIX` continues to opt into one.
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 Then choose **File → Open**. The log should contain `GetOpenFileNameW` and `DIALOG_ParseTemplate32 ... CAPTION L"Open"`.
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
```