summaryrefslogtreecommitdiffstats
path: root/twin/client.cpp
diff options
context:
space:
mode:
authorDarrell Anderson <humanreadable@yahoo.com>2012-02-25 00:21:37 -0600
committerDarrell Anderson <humanreadable@yahoo.com>2012-02-25 00:21:37 -0600
commit4b55c92774c89da479f4c63593f81963be3c4e35 (patch)
tree46b577907e7b22726c601f8b6671b317188e47f3 /twin/client.cpp
parentfc2650816b4b95f21750c53c0d45daeff31510d6 (diff)
parentb45137ace06b893d9ff65b2d45fba978cb4f26ce (diff)
downloadtdebase-4b55c92774c89da479f4c63593f81963be3c4e35.tar.gz
tdebase-4b55c92774c89da479f4c63593f81963be3c4e35.zip
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tdebase
Diffstat (limited to 'twin/client.cpp')
-rw-r--r--twin/client.cpp33
1 files changed, 31 insertions, 2 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())