Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

electron: Document native wayland flags #430

Merged
merged 3 commits into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions docs/electron.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,13 @@ Sandbox permissions
-------------------

The standard guidelines on sandbox permissions apply to Electron
applications. However, Electron does not currently support Wayland, so for
display access, only X11 should be used. The sample app also configures
pulseaudio for sound and enables network access:
applications. However, Electron does not use Wayland by default. So for
display access, only X11 should be used as the default configuration.
This will make Electron use Xwayland in a wayland session and nothing
else is required.

The sample app also configures pulseaudio for sound and enables network
access.

.. code-block:: yaml

Expand All @@ -121,6 +125,28 @@ pulseaudio for sound and enables network access:
- --socket=pulseaudio
- --share=network

.. note::

Native wayland support in electron is experimental and often unstable.
It is advised to stick with the X11 and Xwayland configuration above
as the default.

To enable experimental `native Wayland` support in Electron>=20, the
``--ozone-platform-hint=auto`` flag can be passed to the program. `auto`
will choose Wayland when the seesion is wayland and Xwayland or X11
otherwise.

The recommended option is to leave it to the user. So ``--socket=x11``
should be used in manifest and Wayland can be tested with::

flatpak run --socket=wayland org.flathub.electron-sample-app

To make native wayland the `default` for users ``--socket=fallback-x11``
and ``--socket=wayland`` must be used in the manifest.

Client-side window decorations in native wayland can be enabled by
passing ``--enable-features=WaylandWindowDecorations`` (Electron>=17).

Electron uses ``libnotify`` on Linux to provide desktop notifications.
libnotify `since 0.8.0 <https://gitlab.gnome.org/GNOME/libnotify/-/merge_requests/27>`_
automatically uses the `notification portal <https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Notification.html>`_
Expand Down
Loading