The simplest solution might be the correct one, looks like. I updated my graphics card drivers and there's no sign of the bug anymore. I was using Radeon 17.2.1, now I'm on 17.4.4.