File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
packages/app-builder-lib/src/targets Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " app-builder-lib " : patch
3+ ---
4+
5+ fix: change default value of disable_wayland depending on electron version (in order to support elevtron >38)
Original file line number Diff line number Diff line change @@ -135,8 +135,7 @@ export default class SnapTarget extends Target {
135135 delete snap . plugs
136136 } else {
137137 const archTriplet = archNameToTriplet ( arch )
138- appDescriptor . environment = {
139- DISABLE_WAYLAND : options . allowNativeWayland ? "" : "1" ,
138+ const environment : Record < string , string > = {
140139 PATH : "$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH" ,
141140 SNAP_DESKTOP_RUNTIME : "$SNAP/gnome-platform" ,
142141 LD_LIBRARY_PATH : [
@@ -147,6 +146,20 @@ export default class SnapTarget extends Target {
147146 ] . join ( ":" ) ,
148147 ...options . environment ,
149148 }
149+ // Determine whether Wayland should be disabled based on:
150+ // - Electron version (<38 historically had Wayland disabled)
151+ // - Explicit allowNativeWayland override.
152+ // https://github.com/electron-userland/electron-builder/issues/9320
153+ const allow = options . allowNativeWayland
154+ const isOldElectron = ! this . isElectronVersionGreaterOrEqualThan ( "38.0.0" )
155+ if (
156+ ( allow == null && isOldElectron ) || // No explicit option -> use legacy behavior for old Electron
157+ allow === false // Explicitly disallowed
158+ ) {
159+ environment . DISABLE_WAYLAND = "1"
160+ }
161+
162+ appDescriptor . environment = environment
150163
151164 if ( plugs != null ) {
152165 for ( const plugName of plugNames ) {
You can’t perform that action at this time.
0 commit comments