diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 8e6a87a0b..2c9b66927 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -24,6 +24,8 @@ if (PAM_FOUND) define_pam_service(kscreensaver) endif (PAM_FOUND) +set(KWIN_BIN "kwin_x11" CACHE STRING "Name of the KWin binary") + find_program(some_x_program NAMES iceauth xrdb xterm) if (NOT some_x_program) set(some_x_program /usr/bin/xrdb) diff --git a/ksmserver/config-ksmserver.h.cmake b/ksmserver/config-ksmserver.h.cmake index 939632c86..a454a4d0b 100644 --- a/ksmserver/config-ksmserver.h.cmake +++ b/ksmserver/config-ksmserver.h.cmake @@ -10,3 +10,5 @@ #endif #define KSCREENLOCKER_GREET_BIN "${CMAKE_INSTALL_PREFIX}/${LIBEXEC_INSTALL_DIR}/kscreenlocker_greet" + +#define KWIN_BIN "${KWIN_BIN}" \ No newline at end of file diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp index 644013b33..dc2a3e5c7 100644 --- a/ksmserver/server.cpp +++ b/ksmserver/server.cpp @@ -1002,8 +1002,8 @@ bool KSMServer::defaultSession() const // - if that fails, just use KWin void KSMServer::selectWm( const QString& kdewm ) { - wm = QStringLiteral( "kwin" ); // defaults - wmCommands = ( QStringList() << QStringLiteral( "kwin" ) ); + wm = QStringLiteral( KWIN_BIN ); // defaults + wmCommands = ( QStringList() << QStringLiteral( KWIN_BIN ) ); if( qstrcmp( getenv( "KDE_FAILSAFE" ), "1" ) == 0 ) return; // failsafe, force kwin if( !kdewm.isEmpty()) diff --git a/ksmserver/startup.cpp b/ksmserver/startup.cpp index 7fa10376c..c19483089 100644 --- a/ksmserver/startup.cpp +++ b/ksmserver/startup.cpp @@ -34,6 +34,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include #include // HAVE_LIMITS_H +#include #include #include @@ -200,11 +201,11 @@ void KSMServer::wmProcessChange() if( wmProcess->state() == QProcess::NotRunning ) { // wm failed to launch for some reason, go with kwin instead kWarning( 1218 ) << "Window manager" << wm << "failed to launch"; - if( wm == QStringLiteral( "kwin" ) ) + if( wm == QStringLiteral( KWIN_BIN ) ) return; // uhoh, kwin itself failed kDebug( 1218 ) << "Launching KWin"; - wm = QStringLiteral( "kwin" ); - wmCommands = ( QStringList() << QStringLiteral( "kwin" ) ); + wm = QStringLiteral( KWIN_BIN ); + wmCommands = ( QStringList() << QStringLiteral( KWIN_BIN ) ); // launch it launchWM( QList< QStringList >() << wmCommands ); return;