From f8886f4f01ef6517b53b0d4a669daac1209352b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 10 Nov 2003 18:09:16 +0000 Subject: [PATCH] Make sure desktop is active after startup if there's no other window active svn path=/trunk/kdebase/kwin/; revision=266152 --- workspace.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/workspace.cpp b/workspace.cpp index 8f0da44e5f..50caf3332d 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -423,7 +423,11 @@ void Workspace::addClient( Client* c, allowed_t ) grp->gotLeader( c ); if ( c->isDesktop() ) + { desktops.append( c ); + if( active_client == NULL && should_get_focus.isEmpty() && c->isOnCurrentDesktop()) + requestFocus( c ); // CHECKME? make sure desktop is active after startup if there's no other window active + } else { if ( c->wantsTabFocus() && !focus_chain.contains( c )) @@ -1002,19 +1006,16 @@ bool Workspace::setCurrentDesktop( int new_desktop ) setActiveClient( NULL, Allowed ); if ( c ) - { requestFocus( c ); - } else - { focusToNull(); - } + if( !desktops.isEmpty() ) { Window w_tmp; int i_tmp; XGetInputFocus( qt_xdisplay(), &w_tmp, &i_tmp ); - if( w_tmp == null_focus_window ) + if( w_tmp == null_focus_window ) // CHECKME? requestFocus( findDesktop( true, currentDesktop())); }