Just tested Ubuntu MATE with Compiz and had no issues switching keyboard layout, so probably the problem lies within Unity code.
Just tested Ubuntu MATE with Compiz and had no issues switching keyboard layout, so probably the problem lies within Unity code.