diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-02-23 15:21:04 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-02-23 15:21:04 -0600 |
commit | b45137ace06b893d9ff65b2d45fba978cb4f26ce (patch) | |
tree | cd48a758746d356c98a141b5a3cc3f11c4248efe /twin | |
parent | ca1a4375014b6f78a06c74169a1285abbcbcd819 (diff) | |
download | tdebase-b45137ace06b893d9ff65b2d45fba978cb4f26ce.tar.gz tdebase-b45137ace06b893d9ff65b2d45fba978cb4f26ce.zip |
Fix incomplete commits 98ead41b and 678bea5b
Diffstat (limited to 'twin')
-rw-r--r-- | twin/client.cpp | 33 | ||||
-rw-r--r-- | twin/resumer/resumer.cpp | 4 |
2 files changed, 33 insertions, 4 deletions
diff --git a/twin/client.cpp b/twin/client.cpp index 56b92e699..e6bb2b720 100644 --- a/twin/client.cpp +++ b/twin/client.cpp @@ -1841,6 +1841,9 @@ void Client::killProcess( bool ask, Time timestamp ) bool Client::isSuspendable() const { + bool cansuspend = true; + if( skipTaskbar() || skipPager() ) + return false; TQCString machine = wmClientMachine( true ); pid_t pid = info->pid(); if( pid <= 0 || machine.isEmpty()) // needed properties missing @@ -1872,7 +1875,30 @@ bool Client::isSuspendable() const if( state != 'T' ) { fclose(procfile); - return true; + // Make sure no windows of this process are special + for ( ClientList::ConstIterator it = workspace()->clients.begin(); it != workspace()->clients.end(); ++it) + { + Client* nextclient = *it; + pid_t nextpid = nextclient->info->pid(); + TQCString nextmachine = nextclient->wmClientMachine( true ); + if( nextpid > 0 && (!nextmachine.isEmpty())) + { + if( ( nextmachine == "localhost" ) && ( pid == nextpid ) ) + { + if( nextclient->skipTaskbar() || nextclient->skipPager() ) + cansuspend = false; + } + } + } + // Process exception list + TQString execname(tcomm); + execname.truncate(execname.length()-1); + execname = execname.remove(0,1); + // FIXME This list should not be hardcoded + if( (execname == "kdesktop") || (execname == "kicker") ) + return false; + else + return cansuspend; } else { @@ -1935,6 +1961,7 @@ bool Client::queryUserSuspendedResume() { return false; } + // FIXME We should display a busy cursor until twin_resumer_helper loads process_resumer = new KProcess( this ); *process_resumer << KStandardDirs::findExe( "twin_resumer_helper" ) << "--pid" << TQCString().setNum( info->pid() ) << "--hostname" << wmClientMachine( true ) @@ -2035,7 +2062,8 @@ void Client::processKillerExited() void Client::processResumerExited() { kdDebug( 1212 ) << "Resumer exited" << endl; - if (process_resumer->exitStatus() == 0) + // 0 means the user clicked Resume; 2 means that the resumer dialog failed to launch somehow + if ((process_resumer->exitStatus() == 0) || (process_resumer->exitStatus() == 2)) { resumeWindow(); takeFocus( Allowed ); @@ -2672,6 +2700,7 @@ void Client::setCursor( Position m ) } // TODO mit nejake checkCursor(), ktere se zavola v manage() a pri vecech, kdy by se kurzor mohl zmenit? +// TRANSLATION: TODO: have a checkCursor() function, which is called both in manage() and in cases where the cursor might change void Client::setCursor( const TQCursor& c ) { if( c.handle() == cursor.handle()) diff --git a/twin/resumer/resumer.cpp b/twin/resumer/resumer.cpp index d503e49a7..6a3477bb0 100644 --- a/twin/resumer/resumer.cpp +++ b/twin/resumer/resumer.cpp @@ -59,9 +59,9 @@ int main( int argc, char* argv[] ) Window id = args->getOption( "wid" ).toULong( &id_ok ); args->clear(); if( !pid_ok || pid == 0 || !id_ok || id == None - || hostname.isEmpty() || caption.isEmpty() || appname.isEmpty()) + || hostname.isEmpty() || caption.isEmpty()) { - KCmdLineArgs::usage( i18n( "This helper utility is not supposed to be called directly." )); + printf("%s\n", i18n( "This helper utility is not supposed to be called directly." ).ascii()); return 2; } TQString question = i18n( |