OSDN Git Service

ark: hack for KMediaPlayer part
authorIvailo Monev <xakepa10@gmail.com>
Sun, 27 Nov 2022 00:10:04 +0000 (02:10 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 27 Nov 2022 00:10:04 +0000 (02:10 +0200)
note that it is MPV itself that requires it thus the media classes (such as
KMediaPlayer, KMediaWidget, etc.) require it

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
ark/app/main.cpp

index 493e22a..435e1de 100644 (file)
 #include <QByteArray>
 #include <QFileInfo>
 
+// NOTE: this has to be done before application instance is created and KMediaPlayer part requires
+// it, i.e. it is too late to do it from the kmediaplayer library itself if it is dlopen-ed
+#if defined(Q_WS_X11)
+static int ark_x11_init_threads() {
+    QApplication::setAttribute(Qt::AA_X11InitThreads, true);
+    return 1;
+};
+Q_CONSTRUCTOR_FUNCTION(ark_x11_init_threads)
+#endif
+
 using Kerfuffle::AddToArchive;
 
 int main(int argc, char **argv)