Now this is interesting: Only compton and compiz are affected by this bug. I tested it with Kwin and xfwm4 with compositing enabled but it just doesn't happen. Also this bug can only be reproduced once - after that I need to restart my PC to trigger it (relogin is not enough). Hope this was helpful.