From 025afafa8e7bbafebd32651b6895ee68ec1c825b Mon Sep 17 00:00:00 2001 From: j-b-m Date: Tue, 27 Feb 2024 20:44:47 +0100 Subject: [PATCH] Also check for Wayland's WAYLAND_DISPLAY to detect a graphical session (#972) * Also check for Wayland's WAYLAND_DISPLAY to detect a graphical session * Correct error message on missing graphical session --- src/modules/glaxnimate/producer_glaxnimate.cpp | 6 +++--- src/modules/qt/common.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/glaxnimate/producer_glaxnimate.cpp b/src/modules/glaxnimate/producer_glaxnimate.cpp index dbf406a0e..12fe403ca 100644 --- a/src/modules/glaxnimate/producer_glaxnimate.cpp +++ b/src/modules/glaxnimate/producer_glaxnimate.cpp @@ -140,11 +140,11 @@ static bool createQApplicationIfNeeded(mlt_service service) + QStringLiteral("/plugins")); #endif #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) - if (getenv("DISPLAY") == 0) { + if (getenv("DISPLAY") == 0 && getenv("WAYLAND_DISPLAY") == 0) { mlt_log_error( service, - "The MLT Qt module requires a X11 environment.\n" - "Please either run melt from an X session or use a fake X server like xvfb:\n" + "The MLT Glaxnimate module requires a X11 or Wayland environment.\n" + "Please either run melt from a session with a display server or use a fake X server like xvfb:\n" "xvfb-run -a melt (...)\n"); return false; } diff --git a/src/modules/qt/common.cpp b/src/modules/qt/common.cpp index 60ffea067..02d45f51f 100644 --- a/src/modules/qt/common.cpp +++ b/src/modules/qt/common.cpp @@ -36,11 +36,11 @@ bool createQApplicationIfNeeded(mlt_service service) + QStringLiteral("/plugins")); #endif #if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) - if (getenv("DISPLAY") == 0) { + if (getenv("DISPLAY") == 0 && getenv("WAYLAND_DISPLAY") == 0) { mlt_log_error( service, - "The MLT Qt module requires a X11 environment.\n" - "Please either run melt from an X session or use a fake X server like xvfb:\n" + "The MLT Qt module requires a X11 or Wayland environment.\n" + "Please either run melt from a session with a display server or use a fake X server like xvfb:\n" "xvfb-run -a melt (...)\n"); return false; }