Make sure desktop is active after startup if there's no other window active

svn path=/trunk/kdebase/kwin/; revision=266152
This commit is contained in:
Luboš Luňák 2003-11-10 18:09:16 +00:00
parent 70645a691a
commit f8886f4f01

View file

@ -423,7 +423,11 @@ void Workspace::addClient( Client* c, allowed_t )
grp->gotLeader( c ); grp->gotLeader( c );
if ( c->isDesktop() ) if ( c->isDesktop() )
{
desktops.append( c ); 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 else
{ {
if ( c->wantsTabFocus() && !focus_chain.contains( c )) if ( c->wantsTabFocus() && !focus_chain.contains( c ))
@ -1002,19 +1006,16 @@ bool Workspace::setCurrentDesktop( int new_desktop )
setActiveClient( NULL, Allowed ); setActiveClient( NULL, Allowed );
if ( c ) if ( c )
{
requestFocus( c ); requestFocus( c );
}
else else
{
focusToNull(); focusToNull();
}
if( !desktops.isEmpty() ) if( !desktops.isEmpty() )
{ {
Window w_tmp; Window w_tmp;
int i_tmp; int i_tmp;
XGetInputFocus( qt_xdisplay(), &w_tmp, &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())); requestFocus( findDesktop( true, currentDesktop()));
} }