From 62a2e3506cf9391aa07b1ee19e88a5339739c8ee Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sun, 2 Oct 2011 12:08:37 +0000
Subject: [PATCH] try not to create window > screen

---
 Fltk/graphicWindow.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp
index 48ced566eb..987cb00295 100644
--- a/Fltk/graphicWindow.cpp
+++ b/Fltk/graphicWindow.cpp
@@ -479,8 +479,13 @@ graphicWindow::graphicWindow(bool main, int numTiles)
   int glheight = CTX::instance()->glSize[1];
   int height = glheight + mheight + sh;
 
-  // FIXME: make sure height < screen_height
-
+  // make sure height < screen height
+  if(height > Fl::h()){
+    mheight = 100;
+    glheight = Fl::h() - mheight - sh;
+    CTX::instance()->msgSize = mheight;
+    CTX::instance()->glSize[1] = glheight;
+  }
 
   // no tile should be zero during tile creation
   if(CTX::instance()->msgSize <= 0 || CTX::instance()->msgSize >= glheight){
-- 
GitLab