Bug 10048 - PATCH: Passive grabs are not released in CloseDownClient.
Summary: PATCH: Passive grabs are not released in CloseDownClient.
Status: RESOLVED NOTABUG
Alias: None
Product: xorg
Classification: Unclassified
Component: * Other (show other bugs)
Version: git
Hardware: Other All
: low normal
Assignee: Robert Carr
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-20 17:38 UTC by Robert Carr
Modified: 2008-04-03 06:57 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch to fix problem. (1.24 KB, patch)
2007-02-20 17:39 UTC, Robert Carr
no flags Details | Splinter Review
Better... (1.30 KB, patch)
2007-02-21 08:29 UTC, Robert Carr
no flags Details | Splinter Review
Release passive grabs by walking tree (1.40 KB, patch)
2007-02-21 08:59 UTC, Robert Carr
no flags Details | Splinter Review
Release passive grabs by walking tree (1.39 KB, patch)
2007-02-21 17:46 UTC, Robert Carr
no flags Details | Splinter Review
Release passive grabs by walking tree (1.48 KB, patch)
2007-02-21 18:24 UTC, Robert Carr
no flags Details | Splinter Review

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]
Better...

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.