diff --git a/README.md b/README.md index c87a7aa7..e458f34f 100644 --- a/README.md +++ b/README.md @@ -431,6 +431,10 @@ Do not add `-dUNICODERTL` or reuse the application's `.mooncompiler` profile when building the IDE/LCL. These select different string ABIs; adding a define to the Lazarus command line cannot change an already compiled RTL. +Under WSLg, `./lazarus` selects the GTK X11 backend (Xwayland) unless +`GDK_BACKEND` is already set: the WSLg compositor crashes when a window that has +a transient child is destroyed, and the IDE does this on its first run. + Since 2.5.2, the IDE profile preserves the FPC `TStringList` insertion hooks used by Lazarus subclasses. The Unicode application profile retains the Delphi insertion contract. Both profiles are checked independently in CI. diff --git a/lazarus b/lazarus index 1e840630..10e73684 100755 --- a/lazarus +++ b/lazarus @@ -16,4 +16,9 @@ export PP="$IDE_FPC" export PPC_CONFIG_PATH="$IDE_TOOLCHAIN/etc" export LAZARUSDIR="$LAZARUS_SOURCE" unset FPCDIR +# The WSLg compositor crashes when a window that has a transient child is +# destroyed, which the IDE does on its first run; Xwayland is not affected. +if [[ -z ${GDK_BACKEND-} && -d /mnt/wslg ]]; then + export GDK_BACKEND=x11 +fi exec "$LAZARUS_EXE" "--pcp=$PRIMARY_CONFIG" "$@"