control: tags + patch

Hello,
unfortunately upstream had dropped Qt altogether,
but had no release the last years.

I tried what happens if simply avoid all "QX11Info::display()"
by returning early if "QX11Info::isPlatformX11()".
This makes it kind of playable in a short test,
but mouse look is not possible because of following message:
    qt.qpa.wayland: Setting cursor position is not possible on wayland


So I made another attempt to set QT_QPA_PLATFORM=xcb if a Wayland session is 
detected,
like it is done e.g. in FreeCAD or others [1], see attached patch.

Kind regards,
Bernhard


[1]
https://sources.debian.org/src/freecad/1.0.0+dfsg-8/src/Main/MainGui.cpp?hl=109#L109
https://sources.debian.org/src/audacious/4.4.2-1/src/libaudqt/audqt.cc?hl=131#L131
https://sources.debian.org/src/goldendict-ng/25.06.0-2/src/main.cc?hl=266#L266
diff --git a/doomsday/apps/client/src/main_client.cpp b/doomsday/apps/client/src/main_client.cpp
index 077cb0b..11d4ec8 100644
--- a/doomsday/apps/client/src/main_client.cpp
+++ b/doomsday/apps/client/src/main_client.cpp
@@ -47,6 +47,7 @@
 
 #include <QDebug>
 #include <QMessageBox>
+#include <QtGlobal>
 #include <QTranslator>
 #include <de/EscapeParser>
 
@@ -86,6 +87,13 @@ DENG2_IMPORT_LIBRARY(doom)
  */
 int main(int argc, char **argv)
 {
+    // Avoid crash, https://bugs.debian.org/1113738
+    auto platform = qgetenv("QT_QPA_PLATFORM");
+    if (qgetenv("QT_QPA_PLATFORM").isEmpty()) {
+        if (qEnvironmentVariableIsSet("WAYLAND_DISPLAY") && qEnvironmentVariableIsSet("DISPLAY")) {
+            qputenv("QT_QPA_PLATFORM", "xcb");
+        }
+    }
     int exitCode = 0;
     {
         ClientApp::setDefaultOpenGLFormat();

Reply via email to