Found the problem. Unity is unique in that it intercepts handleEvent() and blocks even core from receiving KeyPress events that it wants. So core never gets the KeyPress event and never has the opportunity to XAllowEvents.
This is bad design on Unity's part. But at the same time it's a bad thing that compiz allows plugins to shoot themselves in the feet.
Now trying to find a fix for compiz-core instead of the obvious fix to Unity itself...
Found the problem. Unity is unique in that it intercepts handleEvent() and blocks even core from receiving KeyPress events that it wants. So core never gets the KeyPress event and never has the opportunity to XAllowEvents.
This is bad design on Unity's part. But at the same time it's a bad thing that compiz allows plugins to shoot themselves in the feet.
Now trying to find a fix for compiz-core instead of the obvious fix to Unity itself...