From kde-devel Tue Aug 20 13:48:58 2002 From: Roland Seuhs Date: Tue, 20 Aug 2002 13:48:58 +0000 To: kde-devel Subject: How does ksmserver start applications? X-MARC-Message: https://marc.info/?l=kde-devel&m=102985129803210 Hi! ksmserver starts applications to restore a session. Unlike kstart, which=20 starts apps on the current desktop and later moves them to another deskto= p,=20 ksmserver starts those apps seamlessly and without flicker and without=20 stealing focus. ksmserver does the following: void KSMServer::startApplication( const QStringList& command ) { if ( command.isEmpty() ) return; int n =3D command.count(); QCString app =3D command[0].latin1(); QValueList argList; for ( int i=3D1; i < n; i++) argList.append( QCString(command[i].latin1())); QByteArray params; QDataStream stream(params, IO_WriteOnly); stream << app << argList; kapp->dcopClient()->send(launcher, launcher,=20 "exec_blind(QCString,QValueList)", params); } However the complete code is quite complicated and I was unable to figure= the=20 mechanism out, especially on which desktop the app ist started. It looks = like=20 there is a dcop-object which gets an stream(string) of commands and=20 parameters - which format does this string have? It would help me a lot if somebody could post a small code snipplet that = uses=20 ksmserver's mechanism to start an app on a specific desktop into the=20 background (=3D without stealing focus).=20 Thanks very much, Roland --=20 Facts do not cease to exist when they are ignored. >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<