Open sepehr opened 1 year ago
@sepehr We aren’t doing that much in terms of fancy work on top of Electron, so this probably isn’t very Compass-specific. At the same time, I’m not an expert for how Electron/Chromium work with different display servers.
Do you know if there would be a way to repro this without having to fully set up a physical machine using wayland?
@addaleax Thanks for the follow-up and apologies for the my late reply.
I have to look closer tbh. However, knowing that there is upstream support for native Wayland in Electron, Compass job is done if we are sure that the arguments it does not recognize are passed downwards to Electron rather than being omitted.
Here's how VSCode output look like when it's passed the wayland-specific arguemnts:
Warning: 'enable-features' is not in the list of known options, but still passed to Electron/Chromium.
Warning: 'ozone-platform' is not in the list of known options, but still passed to Electron/Chromium.
I hope I'll find the time to look into this closer.
I ended up using the rpm
package instead of flatpak. Like this:
mongodb-compass --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland --ignore-additional-command-line-flags
Thanks for your input @ahmafi. I ended up ditching fractional scaling to address my issues. With 200% scaling, things are vivid again.
the flatpak
route did not help me unfortunately as I just got different critical GPU errors:
flatpak run com.mongodb.Compass --enable-features=UseOzonePlatform --ozone-platform=wayland
flatpak run com.mongodb.Compass --enable-features=UseOzonePlatform --ozone-platform=wayland
Note that the directories
'/var/lib/flatpak/exports/share'
'/home/userhome/.local/share/flatpak/exports/share'
are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.
[3:0219/120110.383040:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[3:0219/120110.553187:ERROR:wayland_connection.cc(193)] Failed to connect to Wayland display: No such file or directory (2)
[3:0219/120110.553201:ERROR:ozone_platform_wayland.cc(259)] Failed to initialize Wayland platform
[3:0219/120110.553209:ERROR:env.cc(257)] The platform failed to initialize. Exiting.
/app/bin/run.sh: line 2: 3 Segmentation fault (core dumped) zypak-wrapper '/app/main/MongoDB Compass' "$@"
However, this approach finally did work but after a reboot. I suspect I had too many pre-existing versions of the app already run with different parameters after trying a bunch of different things to get it to start up.
yay -Syu mongodb-compass mongodb-compass --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland --ignore-additional-command-line-flags
Also this is very specific to my distro most likely but I was missing a backend for Manjaro Sway:
sudo pacman -Syu xdg-desktop-portal-gtk
sudo pacman -Syu xdg-desktop-portal-wlr
I'm a little beyond my depth here so I don't know exactly why the above commands are needed but I'm able to run compass now.
It would be great if the app also respected $XDG_CONFIG_HOME/electron-flags.conf
options.
Since Electron 12.x, there is support for native Wayland through the use of these feature flags:
or using
--ozone-platform-hint=auto
. This is the way to avoid a badly-stretched blurry, and hardly-usable UI on HiDPI displays. HiDPI Wayland users usually run VSCode, Chromium itself, and other popular Electron apps like so.Passing those arguments to Compass on a Fedora 37, Gnome 4.32 desktop using:
Compass crashes with:
I wonder how we could safely pass native wayland feature flags down to Electron and Chromium? It's definitely not a pleasure to use Compass in XWayland. Passing
--ignore-additional-command-line-flags
did not help.