Comment 27 for bug 165184

I think Sylvain Vallerot's patch (comment #26) addresses this properly. Works well on my system. Please commit!