summaryrefslogtreecommitdiffstats
path: root/opensuse/core/tdebase/ksmserver-kdeinit.diff
blob: a21b92dc85f6c2486716459b541053de19a13f2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
--- ksmserver/server.h.sav	2009-07-23 11:44:55.000000000 +0200
+++ ksmserver/server.h	2009-07-23 11:47:52.000000000 +0200
@@ -145,7 +145,8 @@ private:
 
     KProcess* startApplication( QStringList command,
         const QString& clientMachine = QString::null,
-        const QString& userId = QString::null );
+        const QString& userId = QString::null,
+        bool wm = false );
     void executeCommand( const QStringList& command );
     
     bool isWM( const KSMClient* client ) const;
--- ksmserver/startup.cpp.sav	2009-07-23 11:44:54.000000000 +0200
+++ ksmserver/startup.cpp	2009-07-23 11:45:49.000000000 +0200
@@ -168,7 +168,7 @@ void KSMServer::launchWM( const QValueLi
     // 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( processExited( KProcess* )), SLOT( wmProcessChange()));
     // there can be possibly more wm's (because of forking for multihead),
     // but in such case care only about the process of the first one
--- ksmserver/server.cpp.sav	2009-07-23 11:51:33.000000000 +0200
+++ ksmserver/server.cpp	2009-07-23 11:49:02.000000000 +0200
@@ -101,7 +101,7 @@ KSMServer* KSMServer::self()
  * to restart applications.
  */
 KProcess* KSMServer::startApplication( QStringList command, const QString& clientMachine,
-    const QString& userId )
+    const QString& userId, bool wm )
 {
     if ( command.isEmpty() )
         return NULL;
@@ -118,12 +118,26 @@ KProcess* KSMServer::startApplication( Q
         command.prepend( clientMachine );
 	command.prepend( xonCommand ); // "xon" by default
     }
-    KProcess* process = new KProcess( this );
-    *process << command;
-    // make it auto-delete
-    connect( process, SIGNAL( processExited( KProcess* )), 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( processExited( KProcess* )), process, SLOT( deleteLater()));
+        process->start();
+        return process;
+    } else {
+        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()));
+        DCOPRef( launcher ).send( "exec_blind", app, DCOPArg( argList, "QValueList<QCString>" ) );
+        return NULL;
+    }
 }
 
 /*! Utility function to execute a command on the local machine. Used