But now there's a race condition - use a server grab to atomatically

check if the window still exists and selecting for events on it.


svn path=/branches/work/kwin_composite/; revision=620295
This commit is contained in:
Luboš Luňák 2007-01-05 16:13:57 +00:00
parent 2cbf4bb1c2
commit 9f48b9dd02

View file

@ -31,10 +31,17 @@ Unmanaged::~Unmanaged()
bool Unmanaged::track( Window w )
{
XWindowAttributes attr;
grabXServer();
if( !XGetWindowAttributes(display(), w, &attr))
{
ungrabXServer();
return false;
}
if( attr.c_class == InputOnly )
{
ungrabXServer();
return false;
}
setHandle( w );
XSelectInput( display(), w, StructureNotifyMask );
geom = QRect( attr.x, attr.y, attr.width, attr.height );
@ -54,6 +61,7 @@ bool Unmanaged::track( Window w )
XShapeSelectInput( display(), w, ShapeNotifyMask );
detectShape( w );
setupCompositing();
ungrabXServer();
return true;
}