diff --git a/src/graphical-interface.impl.cpp b/src/graphical-interface.impl.cpp
index 5907fc87ff8e5d554bfac7f9c66c471d91d579f4..73758f08addd9610e11801e3787884d5e4d84864 100644
--- a/src/graphical-interface.impl.cpp
+++ b/src/graphical-interface.impl.cpp
@@ -129,7 +129,7 @@ namespace graphics {
 
       void GraphicalInterface::threadRefreshing (WindowManagerPtr_t window)
       {
-	while (1)
+	while (!window->done ())
 	  {
 	    mtx_.lock ();
 	    window->frame ();