diff --git a/CMakeLists.txt b/CMakeLists.txt index cedcfb26..2030a2ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,10 @@ find_package(KF5 REQUIRED WindowSystem XmlGui ) +find_package(X11) +set_package_properties(X11 PROPERTIES TYPE OPTIONAL) +set(HAVE_X11 ${X11_FOUND}) + remove_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS -DQT_NO_CAST_FROM_ASCII) add_definitions(-Wno-deprecated-declarations) diff --git a/src/config-konsole.h.cmake b/src/config-konsole.h.cmake index 6ab66903..2c71b47c 100644 --- a/src/config-konsole.h.cmake +++ b/src/config-konsole.h.cmake @@ -7,4 +7,6 @@ /* Defined if on DragonFly BSD */ #cmakedefine HAVE_OS_DRAGONFLYBSD 1 -#define KONSOLE_VERSION "${Konsole_VERSION}" +#cmakedefine01 HAVE_X11 + +#define KONSOLE_VERSION "${Konsole_VERSION}" \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 0074984f..eb07ec5a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -96,8 +96,9 @@ bool shouldUseNewProcess() QStringList qtProblematicOptions; qtProblematicOptions << "session" << "name" << "reverse" << "stylesheet" << "graphicssystem"; - // From X11 +#if HAVE_X11 qtProblematicOptions << "display" << "visual"; +#endif foreach(const QString& option, qtProblematicOptions) { if ( qtArgs->isSet(option.toLocal8Bit()) ) { return true; @@ -108,8 +109,9 @@ bool shouldUseNewProcess() const KCmdLineArgs* kdeArgs = KCmdLineArgs::parsedArgs("kde"); QStringList kdeProblematicOptions; kdeProblematicOptions << "config" << "style"; - // From X11 +#if HAVE_X11 kdeProblematicOptions << "waitforwm"; +#endif foreach(const QString& option, kdeProblematicOptions) { if ( kdeArgs->isSet(option.toLocal8Bit()) ) { return true;