dix/events.c:GrabDevice has if (grab && grab->grabtype != grabtype) *status = AlreadyGrabbed; if (grab && !SameClient(grab, client)) *status = AlreadyGrabbed; else if ((!pWin->realized) || (confineTo && !(confineTo->realized && BorderSizeNotEmpty(dev, confineTo)))) *status = GrabNotViewable; else if ((CompareTimeStamps(time, currentTime) == LATER) || (CompareTimeStamps(time, grabInfo->grabTime) == EARLIER)) *status = GrabInvalidTime; else if (grabInfo->sync.frozen && grabInfo->sync.other && !SameClient(grabInfo->sync.other, client)) *status = GrabFrozen; else { [...] *status = GrabSuccess; } there's pretty clearly a missing 'else' on the second 'if' as compared to what was intended, but fixing it will change the semantics of whether overgrabbing a core grab with a XI2 or vice-versa is allowed. The protocol for GrabDevice says: AlreadyGrabbed: If the device is actively grabbed by some other client. and doesn't describe the interaction with the core protocol.
Looking at the commit that introduced this, xorg-server-1.5.99.1-782-g09f9a86, it clearly intended _not_ to allow grabs of different type to override each other. Do you have a use-case where this is necessary?
(In reply to comment #1) > Do you have a use-case where this is necessary? Nope. It might break somebody else's broken client, though, and it's not specced behavior.
http://patchwork.freedesktop.org/patch/12662/
commit dd3242c87a0a58cba055eb99c0c3fcf03153e4b8 Author: Peter Hutterer <peter.hutterer@who-t.net> Date: Fri Dec 14 11:34:15 2012 +1000 dix: don't allow overriding a grab with a different type of grab (#58255)
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.