element-hq / element-hq/element-web
Crash on launch on wayland (sway) with mixed-scaled dual monitor setup
- Dominant language
- TypeScript
- Stars
- 13.5k
- Forks
- 2.8k
- PR merge metrics
- PR metrics pending
Description
### Description
Since a couple of weeks / months, `element-desktop-nightly` fails to start on wayland (sway 1.8.1) - the window opens and immediately closes.
Today I took the time to investigate this further.
Launching `element-desktop-nightly --enable-features=UseOzonePlatform --ozone-platform=wayland` immediately crashes with the following error message:
[14094:0416/110801.824532:ERROR:wayland_event_watcher.cc(39)] libwayland: xdg_wm_base@15: error 4: wrong configure serial: 6263
This only (and always) happens on a specific dual monitor configuration (one monitor scaled, another monitor unscaled) when launching element on the **right** (no matter if the left or the right monitor is scaled!) monitor. Launching element on the left monitor and moving it afterwards does not cause this issue. (**<- Simple Workaround!**)
This is a sample sway config causing the issue:
output HDMI-A-1 pos 0 0 res 1920x1200
output DP-1 pos 1920 0 res 3840x2160 scale 2
As I assume that this is an electron issue (also reported for chromium: [arch bug tracker](https://bugs.archlinux.org/task/78149), [nix bug tracker](https://github.com/NixOS/nixpkgs/issues/225277), [upstream](https://bugs.chromium.org/p/chromium/issues/detail?id=1430657)), I tried to replicate the issue with other versions and other apps:
- `element-desktop-nightly 2023041501` (current nightly, electron 4.0.0) has the issue (this report).
- `element-desktop 1.11.29` (current stable, electron 23.1.3) behaves similarly, but not as reliably (sometimes crashes only after a couple of seconds, also on the left monitor) and doesn't output above error.
- `signal-desktop 6.14.0` (electron 22.3.5) doesn't have that issue.
- `wire-desktop 3.30.3018` (electron 21.3.3) doesn't have this issue.
- `chromium 112.0.5615` also has this issue - same error message as above.
Unfortunately I wasn't able to provoke this issue with the much simpler [electron/electron-quick-start](https://github.com/electron/electron-quick-start) with either electron 24.0.0 or 24.1.1.
### Operating system
Debian Linux
### Application version
Element nightly 2023041501
### How did you install the app?
element.io deb repository
### Homeserver
matrix.org
### Will you send logs?
No
Contributor guide
Research direction
Reproduce the crash with element-desktop-nightly using --enable-features=UseOzonePlatform --ozone-platform=wayland and the sample mixed-scale sway configuration, launching on the right monitor. Compare the listed Element, Electron, Signal, Wire, and Chromium versions, then review the linked Chromium and Electron reports. Done means Element launches reliably on this configuration without the wrong configure serial crash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, linux
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100