[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/ksmserver
From: Luboš Luňák <l.lunak () kde ! org>
Date: 2009-05-12 17:35:32
Message-ID: 1242149732.171014.22390.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 967149 by lunakl:
Use KProcess only for launching the window manager, not for everything,
as that prevents the usage of kdeinit. Even wms should use klauncher/kdeinit,
to be done somewhen later.
M +24 -8 server.cpp
M +2 -1 server.h
M +1 -1 startup.cpp
--- trunk/KDE/kdebase/workspace/ksmserver/server.cpp #967148:967149
@@ -98,7 +98,7 @@
* to restart applications.
*/
KProcess* KSMServer::startApplication( const QStringList& cmd, const QString& \
clientMachine,
- const QString& userId )
+ const QString& userId, bool wm )
{
QStringList command = cmd;
if ( command.isEmpty() )
@@ -116,13 +116,29 @@
command.prepend( clientMachine );
command.prepend( xonCommand ); // "xon" by default
}
- KProcess* process = new KProcess( this );
- *process << command;
- // make it auto-delete
- connect( process, SIGNAL( error( QProcess::ProcessError )), process, SLOT( \
deleteLater()));
- connect( process, SIGNAL( finished( int, QProcess::ExitStatus )), process, SLOT( \
deleteLater()));
- process->start();
- return process;
+
+// TODO this function actually should not use KProcess at all and use klauncher \
(kdeinit) instead. +// Klauncher should also have support for tracking whether the \
launched process is still alive +// or not, so this should be redone. For now, use \
KProcess for wm's, as they need to be tracked, +// klauncher for the rest where \
ksmserver doesn't care. + if( wm ) {
+ KProcess* process = new KProcess( this );
+ *process << command;
+ // make it auto-delete
+ connect( process, SIGNAL( error( QProcess::ProcessError )), process, SLOT( \
deleteLater())); + connect( process, SIGNAL( finished( int, \
QProcess::ExitStatus )), process, SLOT( deleteLater())); + process->start();
+ return process;
+ } else {
+ int n = command.count();
+ org::kde::KLauncher klauncher("org.kde.klauncher", "/KLauncher", \
QDBusConnection::sessionBus()); + QString app = command[0];
+ QStringList argList;
+ for ( int i=1; i < n; i++)
+ argList.append( command[i]);
+ klauncher.exec_blind(app, argList );
+ return NULL;
+ }
}
/*! Utility function to execute a command on the local machine. Used
--- trunk/KDE/kdebase/workspace/ksmserver/server.h #967148:967149
@@ -161,7 +161,8 @@
KProcess* startApplication( const QStringList& command,
const QString& clientMachine = QString(),
- const QString& userId = QString() );
+ const QString& userId = QString(),
+ bool wm = false );
void executeCommand( const QStringList& command );
bool isWM( const KSMClient* client ) const;
--- trunk/KDE/kdebase/workspace/ksmserver/startup.cpp #967148:967149
@@ -148,7 +148,7 @@
// when we have a window manager, we start it first and give
// it some time before launching other processes. Results in a
// visually more appealing startup.
- wmProcess = startApplication( wmStartCommands[ 0 ] );
+ wmProcess = startApplication( wmStartCommands[ 0 ], QString(), QString(), true \
);
connect( wmProcess, SIGNAL( error( QProcess::ProcessError )), SLOT( \
wmProcessChange()));
connect( wmProcess, SIGNAL( finished( int, QProcess::ExitStatus )), SLOT( \
wmProcessChange()));
// there can be possibly more wm's (because of forking for multihead),
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic