ksmserver: try filename match when checking if the command is the window manager

Exec may or may not be set to full path in the .desktop file for the window
manager, still it is like brute-force guess

note that the default in KSMServer::selectWm() is just kwin (filename) but
programs are (usually) looked for first in PATH (QProcess does that now for
example)

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-12-11 12:05:52 +02:00
parent 1bbca06982
commit c920743903

View file

@ -930,7 +930,16 @@ bool KSMServer::isWM( const KSMClient* client ) const
bool KSMServer::isWM( const QString& command ) const
{
return command == wm;
if (command == wm) {
kDebug() << "the window manager is" << command;
return true;
}
// both the command and window manager may or may not be absolute path thus the filename match
if (QFileInfo(command).fileName() == QFileInfo(wm).fileName()) {
kDebug() << "the window manager is" << command;
return true;
}
return false;
}
bool KSMServer::defaultSession() const