Skip to content

fix(windows): delegate to winebrowser under Wine#121

Merged
Byron merged 2 commits into
Byron:mainfrom
gsurrel:wine-awareness
May 11, 2026
Merged

fix(windows): delegate to winebrowser under Wine#121
Byron merged 2 commits into
Byron:mainfrom
gsurrel:wine-awareness

Conversation

@gsurrel

@gsurrel gsurrel commented May 11, 2026

Copy link
Copy Markdown
Contributor

When running a Windows-targeted binary (.exe) under Wine, open requests previously fell back to Wine's bundled explorer.exe, which lacks proper host desktop integration.

This change detects the Wine environment at runtime (via WINEPREFIX, WINELOADER, or WINEDEBUG env variables) and prepends a winebrowser command to the launcher list, because winebrowser is Wine's official utility for forwarding file/URL requests to the host OS's default handler (e.g., xdg-open on Linux, open on macOS).

If winebrowser is unavailable or fails, the existing cmd /c start is used as a fallback. No public API changes or compile-time flags are introduced.

Screencapture of the changes (with a before/after) to compare, on macOS, using a freshly installed wine (using brew install --cask wine@staging):

open-rs-wine-awareness-480p.mov

Screenshot running on Linux Mint, with a Wine instance wrapped by Lutris, starting correctly my default file browser Dolphin:

image

I have not bumped the Cargo.toml version (it should be the patch level) nor the changelog.md as I do not know whether you have your own release workflow. The changelog gives me the impression it's automatically updated, given the comment blocks?

EDIT: LLM usage disclosure: I've used the web interface of Qwen3.6-Plus at chat.qwen.ai to get guidance on what could be different implementation paths. It provided sample code snippets that looked good to me.

gsurrel and others added 2 commits May 11, 2026 08:30
When running a Windows-targeted binary under Wine, open requests previously fell back to Wine's bundled `explorer.exe`, which lacks proper host desktop integration.

This change detects the Wine environment at runtime (via `WINEPREFIX`, `WINELOADER`, or `WINEDEBUG`) and prepends a winebrowser command to the launcher list. `winebrowser` is Wine's official utility for forwarding file/URL requests to the host OS's default handler (e.g., `xdg-open` on Linux, `open` on macOS).

If winebrowser is unavailable or fails, the existing `cmd /c start` fallback is used automatically, preserving backward compatibility. No public API changes or compile-time flags are introduced.

@Byron Byron left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, this looks great!

The video also does a great job, thank you. I was totally unaware that macOS and Wine and Dolphin can somehow work together, miraculous.

A new release is now available: https://github.com/Byron/open-rs/releases/tag/v5.3.5

@Byron Byron merged commit bb28d04 into Byron:main May 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants