knotify: hack for KAudioPlayer

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-12-14 14:51:55 +02:00
parent 5e162c27fe
commit 2edfae16e2

View file

@ -33,6 +33,15 @@
#include "knotify.h"
// NOTE: this has to be done before application instance is created and KAudioPlayer 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 knotify_x11_init_threads() {
QApplication::setAttribute(Qt::AA_X11InitThreads, true);
return 1;
};
Q_CONSTRUCTOR_FUNCTION(knotify_x11_init_threads)
#endif
int main(int argc, char **argv)
{