https://bugs.freedesktop.org/show_bug.cgi?id=108824
--- Comment #12 from Marek Olšák maraeo@gmail.com --- Created attachment 144312 --> https://bugs.freedesktop.org/attachment.cgi?id=144312&action=edit likely fix
This patch should fix it. Thanks to Pierre-Eric for inspiring it.