diff --git a/Fltk/FlGui.cpp b/Fltk/FlGui.cpp
index 5df833250437259fa9482422f6108776feb78c01..6ef75f4b73b801b45eaf21334b0c5a375d3406a0 100644
--- a/Fltk/FlGui.cpp
+++ b/Fltk/FlGui.cpp
@@ -796,8 +796,8 @@ void FlGui::storeCurrentWindowsInfo()
 {
   CTX::instance()->glPosition[0] = graph[0]->win->x();
   CTX::instance()->glPosition[1] = graph[0]->win->y();
-  CTX::instance()->glSize[0] = graph[0]->win->w();
-  CTX::instance()->glSize[1] = (graph[0]->win->h() - graph[0]->bottom->h());
+  CTX::instance()->glSize[0] = graph[0]->getGlWidth();
+  CTX::instance()->glSize[1] = graph[0]->getGlHeight();
   CTX::instance()->msgSize = graph[0]->getMessageHeight();
   CTX::instance()->menuSize = graph[0]->getMenuWidth();
   CTX::instance()->optPosition[0] = options->win->x();
diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp
index e80cf6824e22872f1032c1a25f687b7721f7c90a..1b848ec40e61112c071c81f200a001f09baa77b6 100644
--- a/Fltk/graphicWindow.cpp
+++ b/Fltk/graphicWindow.cpp
@@ -3026,6 +3026,18 @@ void graphicWindow::resizeMenu(int dh)
   onelab->redraw();
 }
 
+int graphicWindow::getGlHeight()
+{
+  int h = win->h() - bottom->h(); // yes, ignore message browser
+  if(bar) h -= bar->h();
+  return h;
+}
+
+int graphicWindow::getGlWidth()
+{
+  return win->w();
+}
+
 void graphicWindow::showMenu()
 {
   if(!onelab || !win->shown()) return;
diff --git a/Fltk/graphicWindow.h b/Fltk/graphicWindow.h
index f3d807ccda0ae7701a4b45971e59cc1d508f5c2a..d0bbcd2c42e969ada370b801455c4cd07630e777 100644
--- a/Fltk/graphicWindow.h
+++ b/Fltk/graphicWindow.h
@@ -46,6 +46,8 @@ class graphicWindow{
   void setTitle(std::string str);
   void setAutoScroll(bool val){ _autoScrollMessages = val; }
   bool getAutoScroll(){ return _autoScrollMessages; }
+  int getGlHeight();
+  int getGlWidth();
   int getMessageHeight();
   void split(openglWindow *g, char how);
   void setAnimButtons(int mode);