Make group transients transient only for windows in the same group that
were mapped before it, not for new ones. This greatly minimizes the posibility of loops and avoids all those problems in #67914 causes by so many dialogs not having their parent specified. svn path=/trunk/kdebase/kwin/; revision=272281
This commit is contained in:
parent
afee9ba0fb
commit
78b84121d7
1 changed files with 12 additions and 6 deletions
18
group.cpp
18
group.cpp
|
@ -292,9 +292,10 @@ bool Client::sameAppWindowRoleMatch( const Client* c1, const Client* c2, bool ac
|
||||||
|
|
||||||
In the case of group transient window, Client::transient_for is NULL,
|
In the case of group transient window, Client::transient_for is NULL,
|
||||||
and Client::groupTransient() returns true. Such window is treated as
|
and Client::groupTransient() returns true. Such window is treated as
|
||||||
if it were transient for every window in its window group, with the exception
|
if it were transient for every window in its window group that has been
|
||||||
of the windows that are (even indirectly) transient for it (quite nasty,
|
mapped _before_ it (or, to be exact, was added to the same group before it).
|
||||||
loops must be avoided).
|
Otherwise two group transients can create loops, which can lead very very
|
||||||
|
nasty things (bug #67914 and all its dupes).
|
||||||
|
|
||||||
Client::original_transient_for_id is the value of the property, which
|
Client::original_transient_for_id is the value of the property, which
|
||||||
may be different if Client::transient_for_id if e.g. forcing NET::Splash
|
may be different if Client::transient_for_id if e.g. forcing NET::Splash
|
||||||
|
@ -347,8 +348,11 @@ void Client::setTransient( Window new_transient_for_id )
|
||||||
for( ClientList::ConstIterator it = group()->members().begin();
|
for( ClientList::ConstIterator it = group()->members().begin();
|
||||||
it != group()->members().end();
|
it != group()->members().end();
|
||||||
++it )
|
++it )
|
||||||
if( *it != this )
|
{
|
||||||
(*it)->addTransient( this );
|
if( *it == this )
|
||||||
|
break; // this means the window is only transient for windows mapped before it
|
||||||
|
(*it)->addTransient( this );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if( transient_for_id != None )
|
else if( transient_for_id != None )
|
||||||
{
|
{
|
||||||
|
@ -726,17 +730,19 @@ void Client::checkGroup()
|
||||||
else
|
else
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
#if 0 // this would make group transients transient for window that were mapped later
|
||||||
for( ClientList::ConstIterator it = group()->members().begin();
|
for( ClientList::ConstIterator it = group()->members().begin();
|
||||||
it != group()->members().end();
|
it != group()->members().end();
|
||||||
++it )
|
++it )
|
||||||
{
|
{
|
||||||
if( !(*it)->groupTransient()) // and its transient for group transients in the new group
|
if( !(*it)->groupTransient()) // and group transients in the new group are transient for it
|
||||||
continue;
|
continue;
|
||||||
if( *it == this )
|
if( *it == this )
|
||||||
continue;
|
continue;
|
||||||
addTransient( *it );
|
addTransient( *it );
|
||||||
}
|
}
|
||||||
checkGroupTransients();
|
checkGroupTransients();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue