diff --git a/.github/workflows/deps-ubuntu-24.04-gcc.txt b/.github/workflows/deps-ubuntu-24.04-gcc.txt index f1b705eeb..a9e665d3c 100644 --- a/.github/workflows/deps-ubuntu-24.04-gcc.txt +++ b/.github/workflows/deps-ubuntu-24.04-gcc.txt @@ -46,6 +46,7 @@ qtbase5-dev qtbase5-dev-tools qtbase5-private-dev qttools5-dev-tools +qtwayland5 software-properties-common ssh-client stk diff --git a/cmake/linux/LinuxDeploy.cmake b/cmake/linux/LinuxDeploy.cmake index 8bc5d244a..f2530a10f 100644 --- a/cmake/linux/LinuxDeploy.cmake +++ b/cmake/linux/LinuxDeploy.cmake @@ -135,6 +135,10 @@ file(GLOB LADSPA "${APP}/usr/lib/${lmms}/ladspa/*.so") # Inform linuxdeploy about remote plugins file(GLOB REMOTE_PLUGINS "${APP}/usr/lib/${lmms}/*Remote*") +# Inform linuxdeploy-plugin-qt about wayland plugin +set(ENV{EXTRA_PLATFORM_PLUGINS} "libqwayland-generic.so") +set(ENV{EXTRA_QT_MODULES} "waylandcompositor") + # Collect, sort and dedupe all libraries list(APPEND LIBS ${LADSPA}) list(APPEND LIBS ${REMOTE_PLUGINS}) diff --git a/cmake/linux/apprun-hooks/wayland-hook.sh b/cmake/linux/apprun-hooks/wayland-hook.sh new file mode 100644 index 000000000..a24a1a563 --- /dev/null +++ b/cmake/linux/apprun-hooks/wayland-hook.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# Configure QPlatform Abstraction (qpa) to prefer X-Protocol C-Bindings (xcb) over Wayland +ME="$( basename "${BASH_SOURCE[0]}")" + +if [ -n "$QT_QPA_PLATFORM" ]; then + echo "[$ME] QT_QPA_PLATFORM=\"$QT_QPA_PLATFORM\" was provided, using." >&2 +else + export QT_QPA_PLATFORM="xcb" + echo "[$ME] Defaulting to QT_QPA_PLATFORM=\"$QT_QPA_PLATFORM\" for compatibility purposes." >&2 + echo "[$ME] To force wayland, set QT_QPA_PLATFORM=\"wayland\" or call using \"-platform wayland\"." >&2 +fi