GNOME Bugzilla – Bug 733068
Fix a deadlock when exiting
Last modified: 2014-11-09 20:25:30 UTC
These patches fix a deadlock when exiting where we would grab the frontend connection, then try to make a button grab on the backend connection. (The lockup was intermittent because the XGrabServer call might or might not have been flushed to the X server.)
Created attachment 280522 [details] [review] Don't grab the server when unmanaging the screen There's no obvious reason for grabbing the X server when unmanaging a screen - the only race conditions a server grab solves are those related to querying and then acting on the results of the query. Our shutdown sequence is correctly ordered according to the ICCCM - we first unselect on the root window, and then we destroy the window owning WM_S<n> so removing the grab should not cause any problems when we are being replaced with another window manager.
Created attachment 280523 [details] [review] MetaDisplay: remove meta_display_grab()/ungrab() Now that we have two connections to the X server, the idea of a ref-counted server grab that might be held across extended portions of code is very dangerous since we might try to use the backend connection while the frontend connection is grabbed. Replace the only usage (which was local) with direct XGrabServer/XUngrabServer usage and remove the meta_display_grab() API.
Review of attachment 280523 [details] [review]: Yep.
Review of attachment 280522 [details] [review]: OK.
Attachment 280522 [details] pushed as 806dabe - Don't grab the server when unmanaging the screen Attachment 280523 [details] pushed as 88a7790 - MetaDisplay: remove meta_display_grab()/ungrab()
*** Bug 733448 has been marked as a duplicate of this bug. ***
*** Bug 704644 has been marked as a duplicate of this bug. ***