DioxusLabs / DioxusLabs/dioxus

Lots of different failing issues under Wayland

Open
#4,505 4 comments 5 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

**Problem**

There's various problems I've encountered with wayland that are pretty annoying.

**Steps To Reproduce**

1. `cargo run` or `dx serve` or launch from VScode:
1. dies very early with Gdk-Message: 23:37:52.770: Error 71 (Protocol error) dispatching to Wayland display.
1. `WAYLAND_DISPLAY="" cargo run` or `WAYLAND_DISPLAY="" dx serve`
1. launches fine, no issues
1. WAYLAND_DISPLAY="", launch via VScode launch config with VScode running on Wayland
1. Panic: `Failed to initialize gtk backend!: BoolError { message: "Failed to initialize GTK", filename: "~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/gtk-0.18.2/src/rt.rs", function: "gtk::rt::init", line: 141 }`
2. ~/.config/code-flags.conf:
```
--enable-features=UseOzonePlatform --enable-features=WaylandWindowDecorations --ozone-platform=wayland --ozone-platform-hint=auto
```
1. `WAYLAND_DISPLAY=""`, launch via VScode launch config under XWayland (none of the above VScode flags)
1. launches fine but the external style sheet doesn't seem to be applied (no animations, nothing styled) and images are showing a question mark.
1. `WAYLAND_DISPLAY=""` (set via `rust-analyzer.runnables.extraEnv`), launch via Rust Analyzer code lens "run" action

**Expected behavior**

1. It would be nice if it launched fine under Wayland and work correctly. That feels probably out of scope of this project? Not sure what's breaking since the error message is so vague. Generally don't have problems with GTK apps running on my machine under Wayland.
2. It should be launchable via VSCode running on Wayland even if app needs Wayland turned off. Again, not sure if it's fixable within this project as I don't know where the problem would be. I certainly have no issues with other GTK apps but I'm not trying to launch them from within VScode.
3. When both VScode and app are running under XWayland, assets should load. This feels probably more within something going wrong with this project?

**Screenshots**

Launched without wayland from XWayland VScode launch config:
Image

Launched without wayland from XWayland VScode run action:
Basically always
Image

Launched without wayland from XWayland VScode debug action or via cargo run on command-line:
Sometimes
Image
Sometimes
Image
What's missing in this screenshot is there's a pre and post animation from this screen. The pre animation isn't ever present even when it looks more correct and the post animation is incorrect (moving in very weird and incorrect paths) and also super choppy when the display is screwed up.

`WAYLAND_DISPLAY= dx serve`:
Same as above although it's more often to render correctly whereas launching from rust analyzer is more likely to have the more serious failure. First launch is always OK as far as I can tell but hitting "r" to launch runs into the issues mentioned (starting animation missing, incorrectly rendered etc).

** Other **
VSCode launch config used to launch app:
```
{
"type": "lldb",
"request": "launch",
"name": "Debug UI",
"cargo": {
"args": ["build"],
},
"env": {
"WAYLAND_DISPLAY": ""
},
}
```

I'm guessing a not insubstantial number of these issues are probably more issues within the GTK3 WebKit2 component itself, although the asset loading issue in particular feels like it's squarely a dioxus issue.

**Environment:**

- Dioxus version: 0.7.0 alpha 3
- Rust version: 1.88
- OS info: Arch Linux w/ 2080 on 570.144, kwin 6.3.5
- App platform: desktop

**Questionnaire**

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.