Made checks in _get_common_ancestor a bit stricter to avoid XQueryTree
XErrors.
This commit is contained in:
parent
87e4dbfda8
commit
eb0ab7681c
|
@ -513,14 +513,14 @@ static Window __get_common_ancestor( Window A, Window B,
|
|||
|
||||
Window root, *childrenB;
|
||||
unsigned totalB;
|
||||
|
||||
do
|
||||
|
||||
while( A != B && A && B )
|
||||
{
|
||||
TSXQueryTree( display, A, &root, &A, children, total );
|
||||
TSXQueryTree( display, B, &root, &B, &childrenB, &totalB );
|
||||
if( childrenB ) TSXFree( childrenB );
|
||||
if( *children ) TSXFree( *children ), *children = NULL;
|
||||
} while( A != B && A && B );
|
||||
}
|
||||
|
||||
if( A && B )
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue