diff --git a/CMakeLists.txt b/CMakeLists.txt index da051f187..70c2aed2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,6 +91,9 @@ if(ALSA_FOUND) set(HAVE_ALSA ON) endif() find_package(X11) +if(X11_FOUND) + set(HAVE_X11 ON) +endif() pkg_check_modules(GSTREAMER gstreamer-1.0) pkg_check_modules(GSTREAMER_BASE gstreamer-base-1.0) pkg_check_modules(GSTREAMER_AUDIO gstreamer-audio-1.0) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 38e3605d9..41df83041 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -491,7 +491,7 @@ optional_source(HAVE_ALSA ) # X11 -optional_source(X11_FOUND SOURCES widgets/osd_x11.cpp) +optional_source(HAVE_X11 SOURCES widgets/osd_x11.cpp) # GStreamer optional_source(HAVE_GSTREAMER diff --git a/src/config.h.in b/src/config.h.in index 3dcdfa61d..af34c284d 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -22,6 +22,7 @@ #cmakedefine HAVE_GIO #cmakedefine HAVE_DBUS +#cmakedefine HAVE_X11 #cmakedefine HAVE_UDISKS2 #cmakedefine HAVE_ALSA #cmakedefine HAVE_DEVICEKIT diff --git a/src/core/metatypes.cpp b/src/core/metatypes.cpp index c6bd7341b..204864755 100644 --- a/src/core/metatypes.cpp +++ b/src/core/metatypes.cpp @@ -27,6 +27,7 @@ # include #endif +#include #include #include #include @@ -100,7 +101,6 @@ void RegisterMetaTypes() { qRegisterMetaTypeStreamOperators("Equalizer::Params"); #ifdef HAVE_DBUS qDBusRegisterMetaType>(); - qDBusRegisterMetaType(); qDBusRegisterMetaType(); qDBusRegisterMetaType(); qDBusRegisterMetaType(); @@ -108,7 +108,9 @@ void RegisterMetaTypes() { qDBusRegisterMetaType(); qDBusRegisterMetaType(); qDBusRegisterMetaType(); +#ifdef HAVE_X11 + qDBusRegisterMetaType(); +#endif #endif } - diff --git a/src/widgets/osd.cpp b/src/widgets/osd.cpp index ffe4f9079..41c1f2bdc 100644 --- a/src/widgets/osd.cpp +++ b/src/widgets/osd.cpp @@ -240,7 +240,7 @@ void OSD::ShowMessage(const QString &summary, const QString &message, const QStr } } -#ifndef HAVE_DBUS +#if !defined(HAVE_X11) && defined(HAVE_DBUS) void OSD::CallFinished(QDBusPendingCallWatcher*) {} #endif