It seems that the issue was a gif wallpaper plugin for KDE. After not using the plugin the problem is fixed.