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:
parent
2cbf4bb1c2
commit
9f48b9dd02
1 changed files with 8 additions and 0 deletions
|
@ -31,10 +31,17 @@ Unmanaged::~Unmanaged()
|
||||||
bool Unmanaged::track( Window w )
|
bool Unmanaged::track( Window w )
|
||||||
{
|
{
|
||||||
XWindowAttributes attr;
|
XWindowAttributes attr;
|
||||||
|
grabXServer();
|
||||||
if( !XGetWindowAttributes(display(), w, &attr))
|
if( !XGetWindowAttributes(display(), w, &attr))
|
||||||
|
{
|
||||||
|
ungrabXServer();
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
if( attr.c_class == InputOnly )
|
if( attr.c_class == InputOnly )
|
||||||
|
{
|
||||||
|
ungrabXServer();
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
setHandle( w );
|
setHandle( w );
|
||||||
XSelectInput( display(), w, StructureNotifyMask );
|
XSelectInput( display(), w, StructureNotifyMask );
|
||||||
geom = QRect( attr.x, attr.y, attr.width, attr.height );
|
geom = QRect( attr.x, attr.y, attr.width, attr.height );
|
||||||
|
@ -54,6 +61,7 @@ bool Unmanaged::track( Window w )
|
||||||
XShapeSelectInput( display(), w, ShapeNotifyMask );
|
XShapeSelectInput( display(), w, ShapeNotifyMask );
|
||||||
detectShape( w );
|
detectShape( w );
|
||||||
setupCompositing();
|
setupCompositing();
|
||||||
|
ungrabXServer();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue