How does ksmserver start applications?

Roland Seuhs roland at hasos.com
Mon Aug 26 23:23:16 BST 2002


Hi!

This has been previously posted here:
http://lists.kde.org/?l=kde-devel&m=102985129803210&w=2

I need the information for this program:
http://lists.kde.org/?l=kde-devel&m=102964536723723&w=2

ksmserver starts applications to restore a session. Unlike kstart, which 
starts apps on the current desktop and later moves them to another desktop, 
ksmserver starts those apps seamlessly and without flicker and without 
stealing focus.

ksmserver does the following:

void KSMServer::startApplication( const QStringList& command )
{
    if ( command.isEmpty() )
        return;
    int n = command.count();
    QCString app = command[0].latin1();
    QValueList<QCString> argList;
    for ( int i=1; i < n; i++)
       argList.append( QCString(command[i].latin1()));

      QByteArray params;
      QDataStream stream(params, IO_WriteOnly);
      stream << app << argList;
      kapp->dcopClient()->send(launcher, launcher, 
"exec_blind(QCString,QValueList<QCString>)", params);
}


However the complete code is quite complicated and I was unable to figure the 
mechanism out, especially on which desktop the app ist started. It looks like 
there is a dcop-object which gets an stream(string) of commands and 
parameters - which format does this string have?

It would help me a lot if somebody could post a small code snipplet that uses 
ksmserver's mechanism to start an app on a specific desktop into the 
background (= without stealing focus). 

Thanks very much,

Roland

-- 
"Internet will never be popular." -- Bill Gates





More information about the kde-core-devel mailing list