From 0a26dc39aa1a940f8336107c1f2b5359cae019bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 30 Apr 2007 11:46:54 +0000 Subject: [PATCH] Merging from old trunk: r630817 | lunakl | 2007-02-06 14:55:12 +0100 (Tue, 06 Feb 2007) | 4 lines Don't accidentally set _NET_ACTIVE_WINDOW to 0 when there is an active window. And r612728 from 3.5 branch. svn path=/trunk/KDE/kdebase/workspace/; revision=659533 --- activation.cpp | 5 +++-- workspace.cpp | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/activation.cpp b/activation.cpp index c3d8447a76..378bca460c 100644 --- a/activation.cpp +++ b/activation.cpp @@ -222,8 +222,8 @@ void Workspace::setActiveClient( Client* c, allowed_t ) ++set_active_client_recursion; if( active_client != NULL ) { // note that this may call setActiveClient( NULL ), therefore the recursion counter - active_client->setActive( false ); - } + active_client->setActive( false ); + } active_client = c; Q_ASSERT( c == NULL || c->isActive()); if( active_client != NULL ) @@ -266,6 +266,7 @@ void Workspace::activateClient( Client* c, bool force ) { if( c == NULL ) { + focusToNull(); setActiveClient( NULL, Allowed ); return; } diff --git a/workspace.cpp b/workspace.cpp index b4951ceb52..03dc3f584e 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1324,7 +1324,10 @@ bool Workspace::setCurrentDesktop( int new_desktop ) // and active_client is on_all_desktops and under mouse (hence == old_active_client), // conserve focus (thanks to Volker Schatz ) else if( active_client && active_client->isShown( true ) && active_client->isOnCurrentDesktop()) - c= active_client; + c = active_client; + + if( c == NULL && !desktops.isEmpty()) + c = findDesktop( true, currentDesktop()); if( c != active_client ) setActiveClient( NULL, Allowed );