Fix problem about inheritance from RenderWindow