The real question is: Why does compiz still receive key events while other apps have the keyboard fully grabbed? I'm not entirely sure, but it only seems to happen with modifier-only hotkeys. As such, it's possibly caused by listening to xkbEvent. So it's possible a better long-term solution would be to rewrite modifier-only key handling without using xkbEvent. Not sure.
The real question is: Why does compiz still receive key events while other apps have the keyboard fully grabbed? I'm not entirely sure, but it only seems to happen with modifier-only hotkeys. As such, it's possibly caused by listening to xkbEvent. So it's possible a better long-term solution would be to rewrite modifier-only key handling without using xkbEvent. Not sure.