diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h
index 72403fb3c2621342d9597fb1c697cffffb620bab..c13630e1f6c3e7262051afeca159962fdc29ac22 100644
--- a/Common/DefaultOptions.h
+++ b/Common/DefaultOptions.h
@@ -93,6 +93,7 @@ StringXNumber GeneralOptions_Number[] = {
   { F|O, "FastRedraw" , opt_general_fast_redraw , 1. },
   { F|O, "Axes" , opt_general_axes , 1. },
   { F|O, "SmallAxes" , opt_general_small_axes , 1. },
+  { F|O, "DoubleBuffer" , opt_general_double_buffer , 1. },
   { F|O, "DisplayLists" , opt_general_display_lists , 0. },
   { F|O, "AlphaBlending" , opt_general_alpha_blending , 0. },
   { F|O, "Trackball" , opt_general_trackball , 1. },
diff --git a/Common/GetOptions.cpp b/Common/GetOptions.cpp
index 9e1a73bc3f78878eb7dc2b75887dbb4308603e26..e990af83048b2d60c0f202cbcedb476bf5748900 100644
--- a/Common/GetOptions.cpp
+++ b/Common/GetOptions.cpp
@@ -1,4 +1,4 @@
-// $Id: GetOptions.cpp,v 1.12 2001-02-20 18:32:58 geuzaine Exp $
+// $Id: GetOptions.cpp,v 1.13 2001-02-22 08:16:30 geuzaine Exp $
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -51,8 +51,8 @@ void Print_Usage(char *name){
   Msg(DIRECT, "  -link                 link all views on startup");
   Msg(DIRECT, "  -convert file file    convert an ascii view into a binary one");
   Msg(DIRECT, "Display options:");    
-#ifdef _MOTIF
   Msg(DIRECT, "  -nodb                 disable double buffering");
+#ifdef _XMOTIF
   Msg(DIRECT, "  -noov                 disable overlay visual");
   Msg(DIRECT, "  -flash                allow colormap flashing");
   Msg(DIRECT, "  -samevisual           force same visual for graphics and UI");
@@ -66,7 +66,7 @@ void Print_Usage(char *name){
 #endif
   Msg(DIRECT, "Other options:");      
   Msg(DIRECT, "  -v int                set verbosity level (default: 2)");
-#ifdef _MOTIF
+#ifdef _XMOTIF
   Msg(DIRECT, "  -nothreads            disable threads");
 #endif
   Msg(DIRECT, "  -version              show version number");
diff --git a/Common/Options.cpp b/Common/Options.cpp
index ff2ee6da17dc8724e2df47f9b8dee9b64a57f329..854fd6da693e306caad0641f5bcde163ffbf39ab 100644
--- a/Common/Options.cpp
+++ b/Common/Options.cpp
@@ -1,4 +1,4 @@
-// $Id: Options.cpp,v 1.3 2001-02-20 18:32:58 geuzaine Exp $
+// $Id: Options.cpp,v 1.4 2001-02-22 08:16:30 geuzaine Exp $
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -536,7 +536,7 @@ double opt_general_session_save(OPT_ARGS_NUM){
   if(action & GMSH_SET) CTX.session_save = (int)val;
 #ifdef _FLTK
   if(WID && (action & GMSH_GUI))
-    WID->gen_butt[7]->value(CTX.session_save);
+    WID->gen_butt[8]->value(CTX.session_save);
 #endif
   return CTX.session_save;
 }
@@ -544,7 +544,7 @@ double opt_general_options_save(OPT_ARGS_NUM){
   if(action & GMSH_SET) CTX.options_save = (int)val;
 #ifdef _FLTK
   if(WID && (action & GMSH_GUI))
-    WID->gen_butt[8]->value(CTX.options_save);
+    WID->gen_butt[9]->value(CTX.options_save);
 #endif
   return CTX.options_save;
 }
@@ -623,7 +623,7 @@ double opt_general_terminal(OPT_ARGS_NUM){
     CTX.terminal = (int)val;
 #ifdef _FLTK
   if(WID && (action & GMSH_GUI))
-    WID->gen_butt[6]->value(CTX.terminal);
+    WID->gen_butt[7]->value(CTX.terminal);
 #endif
   return CTX.terminal;
 }
@@ -632,8 +632,8 @@ double opt_general_orthographic(OPT_ARGS_NUM){
     CTX.ortho = (int)val;
 #ifdef _FLTK
   if(WID && (action & GMSH_GUI)){
-    WID->gen_butt[9]->value(CTX.ortho);
-    WID->gen_butt[10]->value(!CTX.ortho);
+    WID->gen_butt[10]->value(CTX.ortho);
+    WID->gen_butt[11]->value(!CTX.ortho);
   }
 #endif
   return CTX.ortho;
@@ -670,16 +670,38 @@ double opt_general_display_lists(OPT_ARGS_NUM){
     CTX.display_lists = (int)val;
 #ifdef _FLTK
   if(WID && (action & GMSH_GUI))
-    WID->gen_butt[3]->value(CTX.display_lists);
+    WID->gen_butt[4]->value(CTX.display_lists);
 #endif
   return CTX.display_lists;
 }
+double opt_general_double_buffer(OPT_ARGS_NUM){
+  if(action & GMSH_SET){
+    CTX.db = (int)val;
+#ifdef _FLTK
+    if(WID){
+      if(CTX.db){
+	Msg(INFO, "Setting Opengl visual to double buffered");
+	WID->g_opengl_window->mode(FL_RGB | FL_DEPTH | FL_DOUBLE);
+      }
+      else{
+	Msg(INFO, "Setting Opengl visual to single buffered");
+	WID->g_opengl_window->mode(FL_RGB | FL_DEPTH | FL_SINGLE);
+      }
+    }
+#endif
+  }
+#ifdef _FLTK
+  if(WID && (action & GMSH_GUI))
+    WID->gen_butt[3]->value(CTX.db);
+#endif
+  return CTX.db;
+}
 double opt_general_alpha_blending(OPT_ARGS_NUM){
   if(action & GMSH_SET) 
     CTX.alpha = (int)val;
 #ifdef _FLTK
   if(WID && (action & GMSH_GUI))
-    WID->gen_butt[4]->value(CTX.alpha);
+    WID->gen_butt[5]->value(CTX.alpha);
 #endif
   return CTX.alpha;
 }
@@ -701,7 +723,7 @@ double opt_general_trackball(OPT_ARGS_NUM){
     CTX.useTrackball = (int)val;
 #ifdef _FLTK
   if(WID && (action & GMSH_GUI))
-    WID->gen_butt[5]->value(CTX.useTrackball);
+    WID->gen_butt[6]->value(CTX.useTrackball);
 #endif
   return CTX.useTrackball;
 }
@@ -833,7 +855,7 @@ double opt_general_moving_light(OPT_ARGS_NUM){
   if(action & GMSH_SET) CTX.moving_light = (int)val;
 #ifdef _FLTK
   if(WID && (action & GMSH_GUI))
-    WID->gen_butt[11]->value(CTX.moving_light);
+    WID->gen_butt[12]->value(CTX.moving_light);
 #endif
   return CTX.moving_light;
 }
diff --git a/Common/Options.h b/Common/Options.h
index c9edaad2d0127f3f68e50404d2a4ba5073f2d10e..a15654234914c4a815bc8d588ff59b3cc0a56563 100644
--- a/Common/Options.h
+++ b/Common/Options.h
@@ -67,6 +67,7 @@ double opt_general_fast_redraw(OPT_ARGS_NUM);
 double opt_general_axes(OPT_ARGS_NUM);
 double opt_general_small_axes(OPT_ARGS_NUM);
 double opt_general_display_lists(OPT_ARGS_NUM);
+double opt_general_double_buffer(OPT_ARGS_NUM);
 double opt_general_alpha_blending(OPT_ARGS_NUM);
 double opt_general_trackball(OPT_ARGS_NUM);
 double opt_general_zoom_factor(OPT_ARGS_NUM);
diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp
index 3aff8e7b09f3ef3c26afca0e2aadaaf0f22c1843..e23a1531ef80ca5454dcdb757e657e7bb9b2d15e 100644
--- a/Fltk/Callbacks.cpp
+++ b/Fltk/Callbacks.cpp
@@ -1,4 +1,4 @@
-// $Id: Callbacks.cpp,v 1.35 2001-02-20 18:32:58 geuzaine Exp $
+// $Id: Callbacks.cpp,v 1.36 2001-02-22 08:16:30 geuzaine Exp $
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -295,14 +295,16 @@ void opt_general_ok_cb(CALLBACK_ARGS){
   opt_general_axes(0, GMSH_SET, WID->gen_butt[0]->value());
   opt_general_small_axes(0, GMSH_SET, WID->gen_butt[1]->value());
   opt_general_fast_redraw(0, GMSH_SET, WID->gen_butt[2]->value());
-  opt_general_display_lists(0, GMSH_SET, WID->gen_butt[3]->value());
-  opt_general_alpha_blending(0, GMSH_SET, WID->gen_butt[4]->value());
-  opt_general_trackball(0, GMSH_SET, WID->gen_butt[5]->value());
-  opt_general_terminal(0, GMSH_SET, WID->gen_butt[6]->value());
-  opt_general_session_save(0, GMSH_SET, WID->gen_butt[7]->value());
-  opt_general_options_save(0, GMSH_SET, WID->gen_butt[8]->value());
-  opt_general_orthographic(0, GMSH_SET, WID->gen_butt[9]->value());
-  opt_general_moving_light(0, GMSH_SET, WID->gen_butt[11]->value());
+  if(opt_general_double_buffer(0, GMSH_GET, 0) != WID->gen_butt[3]->value())
+    opt_general_double_buffer(0, GMSH_SET, WID->gen_butt[3]->value());
+  opt_general_display_lists(0, GMSH_SET, WID->gen_butt[4]->value());
+  opt_general_alpha_blending(0, GMSH_SET, WID->gen_butt[5]->value());
+  opt_general_trackball(0, GMSH_SET, WID->gen_butt[6]->value());
+  opt_general_terminal(0, GMSH_SET, WID->gen_butt[7]->value());
+  opt_general_session_save(0, GMSH_SET, WID->gen_butt[8]->value());
+  opt_general_options_save(0, GMSH_SET, WID->gen_butt[9]->value());
+  opt_general_orthographic(0, GMSH_SET, WID->gen_butt[10]->value());
+  opt_general_moving_light(0, GMSH_SET, WID->gen_butt[12]->value());
 
   opt_general_shine(0, GMSH_SET, WID->gen_value[1]->value());
   opt_general_light00(0, GMSH_SET, WID->gen_value[2]->value());
diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp
index 571490af0b18f124ac380cf39510b50d5cf25019..fd3ec2aa464ca074d9038da6dd659d65c0869eeb 100644
--- a/Fltk/GUI.cpp
+++ b/Fltk/GUI.cpp
@@ -1,4 +1,4 @@
-// $Id: GUI.cpp,v 1.50 2001-02-20 08:23:36 geuzaine Exp $
+// $Id: GUI.cpp,v 1.51 2001-02-22 08:16:30 geuzaine Exp $
 
 // To make the interface as visually consistent as possible, please:
 // - use the BH, BW, WB, IW values for button heights/widths, window borders, etc.
@@ -713,11 +713,14 @@ void GUI::create_graphic_window(int argc, char **argv){
     int glheight = CTX.viewport[3]-CTX.viewport[1];
     int height = glheight + sh;
 
-
     g_window = new Fl_Window(width, height);
     g_window->callback(file_quit_cb);
 
     g_opengl_window = new Opengl_Window(0,0,width,glheight);
+    if(!opt_general_double_buffer(0,GMSH_GET,0)){
+      Msg(INFO, "Setting Opengl visual to single buffered");
+      g_opengl_window->mode(FL_RGB | FL_DEPTH | FL_SINGLE);
+    }
     g_opengl_window->end();
 
     {
@@ -856,10 +859,11 @@ void GUI::create_general_options_window(){
         gen_butt[0] = new Fl_Check_Button(2*WB, 2*WB+1*BH, BW, BH, "Show moving axes");
         gen_butt[1] = new Fl_Check_Button(2*WB, 2*WB+2*BH, BW, BH, "Show small axes");
         gen_butt[2] = new Fl_Check_Button(2*WB, 2*WB+3*BH, BW, BH, "Enable fast redraw");
-        gen_butt[3] = new Fl_Check_Button(2*WB, 2*WB+4*BH, BW, BH, "Use display lists");
-        gen_butt[4] = new Fl_Check_Button(2*WB, 2*WB+5*BH, BW, BH, "Enable alpha blending");
-        gen_butt[5] = new Fl_Check_Button(2*WB, 2*WB+6*BH, BW, BH, "Use trackball rotation mode");
-	for(i=0 ; i<6 ; i++){
+        gen_butt[3] = new Fl_Check_Button(2*WB, 2*WB+4*BH, BW, BH, "Enable double buffering");
+        gen_butt[4] = new Fl_Check_Button(2*WB, 2*WB+5*BH, BW, BH, "Use display lists");
+        gen_butt[5] = new Fl_Check_Button(2*WB, 2*WB+6*BH, BW, BH, "Enable alpha blending");
+        gen_butt[6] = new Fl_Check_Button(2*WB, 2*WB+7*BH, BW, BH, "Use trackball rotation mode");
+	for(i=0 ; i<7 ; i++){
 	  gen_butt[i]->type(FL_TOGGLE_BUTTON);
 	  gen_butt[i]->down_box(FL_DOWN_BOX);
 	  gen_butt[i]->labelsize(CTX.fontsize);
@@ -870,10 +874,10 @@ void GUI::create_general_options_window(){
       { 
 	Fl_Group* o = new Fl_Group(WB, WB+BH, width-2*WB, height-3*WB-2*BH, "Output");
 	o->labelsize(CTX.fontsize);
-        gen_butt[6] = new Fl_Check_Button(2*WB, 2*WB+1*BH, BW, BH, "Print messages on terminal");
-        gen_butt[7] = new Fl_Check_Button(2*WB, 2*WB+2*BH, BW, BH, "Save session information on exit");
-        gen_butt[8] = new Fl_Check_Button(2*WB, 2*WB+3*BH, BW, BH, "Save options on exit");
-	for(i=6 ; i<9 ; i++){
+        gen_butt[7] = new Fl_Check_Button(2*WB, 2*WB+1*BH, BW, BH, "Print messages on terminal");
+        gen_butt[8] = new Fl_Check_Button(2*WB, 2*WB+2*BH, BW, BH, "Save session information on exit");
+        gen_butt[9] = new Fl_Check_Button(2*WB, 2*WB+3*BH, BW, BH, "Save options on exit");
+	for(i=7 ; i<10 ; i++){
 	  gen_butt[i]->type(FL_TOGGLE_BUTTON);
 	  gen_butt[i]->down_box(FL_DOWN_BOX);
 	  gen_butt[i]->labelsize(CTX.fontsize);
@@ -902,9 +906,9 @@ void GUI::create_general_options_window(){
 	Fl_Group* o = new Fl_Group(WB, WB+BH, width-2*WB, height-3*WB-2*BH, "Projection");
 	o->labelsize(CTX.fontsize);
         o->hide();
-        gen_butt[9] = new Fl_Check_Button(2*WB, 2*WB+1*BH, BW, BH, "Orthographic");
-        gen_butt[10] = new Fl_Check_Button(2*WB, 2*WB+2*BH, BW, BH, "Perspective");
-	for(i=9 ; i<11 ; i++){
+        gen_butt[10] = new Fl_Check_Button(2*WB, 2*WB+1*BH, BW, BH, "Orthographic");
+        gen_butt[11] = new Fl_Check_Button(2*WB, 2*WB+2*BH, BW, BH, "Perspective");
+	for(i=10 ; i<12 ; i++){
 	  gen_butt[i]->type(FL_RADIO_BUTTON);
 	  gen_butt[i]->labelsize(CTX.fontsize);
 	  gen_butt[i]->selection_color(FL_YELLOW);
@@ -944,11 +948,11 @@ void GUI::create_general_options_window(){
 	gen_value[1]->minimum(0); 
 	gen_value[1]->maximum(10);
 	gen_value[1]->step(0.1);
-        gen_butt[11] = new Fl_Check_Button(2*WB, 2*WB+2*BH, BW, BH, "Moving light");
-	gen_butt[11]->type(FL_TOGGLE_BUTTON);
-	gen_butt[11]->down_box(FL_DOWN_BOX);
-	gen_butt[11]->labelsize(CTX.fontsize);
-	gen_butt[11]->selection_color(FL_YELLOW);
+        gen_butt[12] = new Fl_Check_Button(2*WB, 2*WB+2*BH, BW, BH, "Moving light");
+	gen_butt[12]->type(FL_TOGGLE_BUTTON);
+	gen_butt[12]->down_box(FL_DOWN_BOX);
+	gen_butt[12]->labelsize(CTX.fontsize);
+	gen_butt[12]->selection_color(FL_YELLOW);
         gen_value[2] = new Fl_Value_Input(2*WB, 2*WB+3*BH, IW, BH, "Light position X");
 	gen_value[2]->minimum(-1); 
 	gen_value[2]->maximum(1);
diff --git a/doc/Changelog b/doc/Changelog
index 4be1a4b442a32c8241e0001f7d9ef06ceadf9f75..fa7718f56d06b25b682bcf65dc40f8ef77f51aa5 100644
--- a/doc/Changelog
+++ b/doc/Changelog
@@ -1,3 +1,7 @@
+New in 1.16: Added single/double buffer selection (only useful for
+Unix versions of Gmsh run from remote hosts without GLX, e.g. with
+Mesa and old X servers on old graphic cards :-();
+
 New in 1.15: Added automatic visibility setting during entity
 selection; Corrected geometrical extrusion bug;
 
diff --git a/doc/gmsh.1 b/doc/gmsh.1
index 329d18f6e6a5430763ec8a14964e3d34594ba960..7adf7939e2e87723b7b633bf14c5da59fd31b19b 100644
--- a/doc/gmsh.1
+++ b/doc/gmsh.1
@@ -158,8 +158,8 @@ views) at startup.
 .SH DISPLAY OPTIONS
 .TP 4
 .B \-nodb
-(Motif versions only) suppress the double buffer. Use this options if
-you use \fIGmsh\fR on a remote host without GLX.
+suppress the double buffer. Use this options if you use \fIGmsh\fR on
+a remote host without GLX.
 .TP 4
 .B \-noov
 (Motif versions only) suppress overlay visual.
diff --git a/utils/build_machines b/utils/build_machines
index e2ed21a0fb5085f7b51f5a5ad0b0ce8cd6ea40d1..e63859ecbdcee5b2927372471de45ca8711616b0 100644
--- a/utils/build_machines
+++ b/utils/build_machines
@@ -1,5 +1,6 @@
-TRU64   elap53.montefiore.ulg.ac.be
+Windows elap15.montefiore.ulg.ac.be/elap74.montefiore.ulg.ac.be
 Linux   elap21.montefiore.ulg.ac.be
+TRU64   elap53.montefiore.ulg.ac.be
 IRIX    elap20.montefiore.ulg.ac.be
 SunOS   montef01.montefiore.ulg.ac.be
 HP-UX   stokes.ltas.ulg.ac.be