From 10672210ae0f4499734a478c0f4567f1c9f5239d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Wed, 23 May 2001 20:39:28 +0000 Subject: [PATCH] Better focus handling when sending windows to other desktops. svn path=/trunk/kdebase/kwin/; revision=98455 --- workspace.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/workspace.cpp b/workspace.cpp index 50aec269e6..e7a60efab4 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -524,7 +524,7 @@ bool Workspace::workspaceEvent( XEvent * e ) } if ( c != desktop_client ) { if ( c->wantsTabFocus() ) - focus_chain.prepend( c ); + focus_chain.append( c ); clients.append( c ); stacking_order.append( c ); } @@ -2736,10 +2736,19 @@ void Workspace::sendClientToDesktop( Client* c, int desk ) c->setDesktop( desk ); - if ( c->isOnDesktop( currentDesktop() ) ) + if ( c->isOnDesktop( currentDesktop() ) ) { c->show(); - else + if ( c->wantsTabFocus() && options->focusPolicyIsReasonable() ) { + requestFocus( c ); + } + } + else { c->hide(); + raiseClient( c ); + focus_chain.remove( c ); + if ( c->wantsTabFocus() ) + focus_chain.append( c ); + } for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it) { if ( (*it)->transientFor() == c->window() ) {