Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/stupid-kiwis-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-lib": patch
---

fix: Optionally allow removing DISABLE_WAYLAND flag for snaps
8 changes: 7 additions & 1 deletion packages/app-builder-lib/src/options/SnapOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export interface SnapOptions extends CommonLinuxOptions, TargetSpecificOptions {

/**
* The list of [plugs](https://snapcraft.io/docs/reference/interfaces).
* Defaults to `["desktop", "desktop-legacy", "home", "x11", "unity7", "browser-support", "network", "gsettings", "audio-playback", "pulseaudio", "opengl"]`.
* Defaults to `["desktop", "desktop-legacy", "home", "x11", "wayland", "unity7", "browser-support", "network", "gsettings", "audio-playback", "pulseaudio", "opengl"]`.
*
* If list contains `default`, it will be replaced to default list, so, `["default", "foo"]` can be used to add custom plug `foo` in addition to defaults.
*
Expand Down Expand Up @@ -130,6 +130,12 @@ export interface SnapOptions extends CommonLinuxOptions, TargetSpecificOptions {
* Sets the compression type for the snap. Can be xz, lzo, or null.
*/
readonly compression?: "xz" | "lzo" | null

/**
* Allow running the program with native wayland support with --ozone-platform=wayland.
* Disabled by default because of this issue in older Electron/Snap versions: https://github.com/electron-userland/electron-builder/issues/4007
*/
readonly allowNativeWayland?: boolean | null
}

export interface PlugDescriptor {
Expand Down
4 changes: 1 addition & 3 deletions packages/app-builder-lib/src/targets/snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ export default class SnapTarget extends Target {
} else {
const archTriplet = archNameToTriplet(arch)
appDescriptor.environment = {
// https://github.com/electron-userland/electron-builder/issues/4007
// https://github.com/electron/electron/issues/9056
DISABLE_WAYLAND: "1",
DISABLE_WAYLAND: options.allowNativeWayland ? "" : "1",
TMPDIR: "$XDG_RUNTIME_DIR",
PATH: "$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH",
SNAP_DESKTOP_RUNTIME: "$SNAP/gnome-platform",
Expand Down