Add a dirty hack to workaround repainting issues and fix razor-qt bug 536.
See https://github.com/Razor-qt/razor-qt/issues/536 for details.