opengl: Ensure graphics is repainted when needed