[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    How does ksmserver start applications?
From:       Roland Seuhs <roland () hasos ! com>
Date:       2002-08-20 13:48:58
[Download RAW message or body]

Hi!

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

-- 
Facts do not cease to exist when they are ignored.



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic