diff --git a/Common/Options.cpp b/Common/Options.cpp index 6ffae185a78b72d332e4d4d8a4696458e6107c08..9767388922349452d94977ffd53ad526fbba8dd8 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -2386,10 +2386,14 @@ double opt_general_graphics_size0(OPT_ARGS_NUM) CTX::instance()->glSize[0] = (int)val; #if defined(HAVE_FLTK) if(GUI::available()){ - if(action & GMSH_SET) + if(action & GMSH_SET){ GUI::instance()->graph[0]->win->size - (CTX::instance()->glSize[0], GUI::instance()->graph[0]->bottom->h() + - CTX::instance()->glSize[1]); + (CTX::instance()->glSize[0], + GUI::instance()->graph[0]->win->h()); + // workaround resizing bug on Mac + GUI::instance()->graph[0]->win->size_range + (GUI::instance()->graph[0]->minWidth, GUI::instance()->graph[0]->minHeight); + } } #endif return CTX::instance()->glSize[0]; @@ -2401,10 +2405,14 @@ double opt_general_graphics_size1(OPT_ARGS_NUM) CTX::instance()->glSize[1] = (int)val; #if defined(HAVE_FLTK) if(GUI::available()){ - if(action & GMSH_SET) + if(action & GMSH_SET){ GUI::instance()->graph[0]->win->size - (CTX::instance()->glSize[0], GUI::instance()->graph[0]->bottom->h() + - CTX::instance()->glSize[1]); + (GUI::instance()->graph[0]->win->w(), + GUI::instance()->graph[0]->bottom->h() + CTX::instance()->glSize[1]); + // workaround resizing bug on Mac + GUI::instance()->graph[0]->win->size_range + (GUI::instance()->graph[0]->minWidth, GUI::instance()->graph[0]->minHeight); + } } #endif return CTX::instance()->glSize[1]; diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp index 0e04f9f53532f63caf7e92357b211bac95f1c443..b133724f4ec3951fb11256242ff28ac6eb918267 100644 --- a/Fltk/graphicWindow.cpp +++ b/Fltk/graphicWindow.cpp @@ -416,6 +416,11 @@ graphicWindow::graphicWindow(bool main, int numTiles) dummyBox *resbox = new dummyBox(x, 0, width - x, glheight); win->resizable(resbox); + // set mininum window size + minWidth = x; + minHeight = 100; + win->size_range(minWidth, minHeight); + // tiled opengl windows tile = new Fl_Tile(0, 0, width, glheight); diff --git a/Fltk/graphicWindow.h b/Fltk/graphicWindow.h index 3747c98514e862ad342cb55f2fd3956d416e6f8c..bcd71e47c3caedfb771b350cdd1c2a4bb2f7b92b 100644 --- a/Fltk/graphicWindow.h +++ b/Fltk/graphicWindow.h @@ -24,6 +24,7 @@ class graphicWindow{ Fl_Box *bottom; Fl_Button *butt[12]; Fl_Box *label[2]; + int minWidth, minHeight; public: graphicWindow(bool main=true, int numTiles=1); ~graphicWindow();