Bug 10048

Summary: PATCH: Passive grabs are not released in CloseDownClient.
Product: xorg Reporter: Robert Carr <racarr>
Component: * OtherAssignee: Robert Carr <racarr>
Status: RESOLVED NOTABUG QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: low    
Version: git   
Hardware: Other   
OS: All   
i915 platform: i915 features:
Description Flags
Patch to fix problem.
Release passive grabs by walking tree
Release passive grabs by walking tree
Release passive grabs by walking tree none

Description Robert Carr 2007-02-20 17:38:38 UTC
In CloseDownClient passive grabs are not released before active grabs are released.
Comment 1 Robert Carr 2007-02-20 17:39:27 UTC
Created attachment 8794 [details] [review]
Patch to fix problem.
Comment 2 Robert Carr 2007-02-21 08:29:15 UTC
Created attachment 8800 [details] [review]

This fixes a potential problem if dixLookupWindow fails, but I think maybe the entire thing is wrong. 

This all seems to be wrong though as I misunderstood what REQUEST is supposed to do.
Comment 3 Robert Carr 2007-02-21 08:59:20 UTC
Created attachment 8801 [details] [review]
Release passive grabs by walking tree

This should work but it's quite possible there is a better way to do it.
Comment 4 Robert Carr 2007-02-21 17:46:02 UTC
Created attachment 8810 [details] [review]
Release passive grabs by walking tree
Comment 5 Robert Carr 2007-02-21 17:49:42 UTC
The reason for the last change is using 
g->next isn't a good idea after deleting the grab and sometimes leads to a segfault.

Just doing
while ((g=wPassiveGrabs(pWin)))
works fine
Comment 6 Robert Carr 2007-02-21 18:24:52 UTC
Created attachment 8811 [details] [review]
Release passive grabs by walking tree

This last patch seems to be necessary when clients get closed down in an order like:
xterm opens app
close xterm app dies xterm dies

Not all the time though. I think I understand why it happens but it's difficult to explain...maybe someone else will be able to articulate it better.

The fact that this is necessary makes me wonder again if there is a better approach to this.
Comment 7 Daniel Stone 2007-02-27 01:36:32 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 8 Peter Hutterer 2008-02-24 23:41:39 UTC
Passive grabs are stored in the resource system and thus freed in FreeClientRessources().
Not sure if that was already the case when you reported the bug but they are freed now.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.