diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp
index e7b3c825336cbbed92f1afdccd96425da9359b5b..dfc6867d89838170ce7491c50341a9a2fa41e48a 100644
--- a/Fltk/Callbacks.cpp
+++ b/Fltk/Callbacks.cpp
@@ -1,4 +1,4 @@
-// $Id: Callbacks.cpp,v 1.13 2001-01-11 07:32:35 geuzaine Exp $
+// $Id: Callbacks.cpp,v 1.14 2001-01-11 12:25:23 geuzaine Exp $
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -761,6 +761,8 @@ void mesh_1d_cb(CALLBACK_ARGS){
   else
 #endif
     mai3d(&M, 1); 
+  Init(); 
+  Draw();
 }
 void mesh_2d_cb(CALLBACK_ARGS){
 #ifdef _USETHREADS
@@ -772,6 +774,8 @@ void mesh_2d_cb(CALLBACK_ARGS){
   else
 #endif
     mai3d(&M, 2);
+  Init(); 
+  Draw();
 } 
 void mesh_3d_cb(CALLBACK_ARGS){
 #ifdef _USETHREADS
@@ -783,6 +787,8 @@ void mesh_3d_cb(CALLBACK_ARGS){
   else
 #endif
     mai3d(&M, 3); 
+  Init(); 
+  Draw();
 } 
 void mesh_define_length_cb (CALLBACK_ARGS){
   Vertex   *v;
@@ -802,20 +808,20 @@ void mesh_define_length_cb (CALLBACK_ARGS){
     if (ib == -1){ /* 'e' */
       if(n >= 1) {
 	add_charlength(n,p,CTX.filename); 
+	n=0;
+	ZeroHighlight(&M);
+	DrawUpdate();
 	break;
       }
-      n=0;
-      ZeroHighlight(&M);
-      Replot();
     }
     if(ib == 0){ /* 'q' */
       n=0 ;
       ZeroHighlight(&M);
-      Replot();
+      DrawUpdate();
       break;
     }
   }
-  if(!CTX.threads) Msg(STATUS,"Ready");
+  Msg(STATUS,"Ready");
 }
 void mesh_define_recombine_cb (CALLBACK_ARGS){
   printf("mesh define reco\n");
diff --git a/Fltk/GUI.h b/Fltk/GUI.h
index 83abd0cda4978e649b4e59b7f6cdee4bb0842854..8c65ba089918c3c3ecacbed5a0771083ea5aa729 100644
--- a/Fltk/GUI.h
+++ b/Fltk/GUI.h
@@ -179,7 +179,7 @@ public:
   void activate_custom(int val);
   void add_handler();
   int  global_shortcuts(int event);
-  int  quit_selection, end_selection;
+  int  try_selection, quit_selection, end_selection;
 
   // geometry contexts queries
   char *get_geometry_parameter(int num);
diff --git a/Fltk/Main.cpp b/Fltk/Main.cpp
index 00e85811cf7900f7eee67f527aba34f98f75f02c..52c52817e69dbf1ff2c3d31b6dcc12b1f9b82c2c 100644
--- a/Fltk/Main.cpp
+++ b/Fltk/Main.cpp
@@ -1,4 +1,4 @@
-// $Id: Main.cpp,v 1.6 2001-01-10 08:50:29 geuzaine Exp $
+// $Id: Main.cpp,v 1.7 2001-01-11 12:25:23 geuzaine Exp $
 
 #include <signal.h>
 
@@ -92,7 +92,6 @@ int main(int argc, char *argv[]){
 
   // The GUI is ready
   CTX.interactive = 0 ; 
-  CTX.expose = 1 ;
 
   // Say welcome!
 
@@ -130,6 +129,7 @@ int main(int argc, char *argv[]){
   // Draw the actual scene
   Init();
   Draw();
+  CTX.expose = 1 ;
 
   // loop
   WID->run();
diff --git a/Fltk/Opengl.cpp b/Fltk/Opengl.cpp
index 83f9ba2876fbd489d4f87e93fe43ca534231f53e..20c53e1c44295b60b8896a07d0160508f00be832 100644
--- a/Fltk/Opengl.cpp
+++ b/Fltk/Opengl.cpp
@@ -1,4 +1,4 @@
-// $Id: Opengl.cpp,v 1.10 2001-01-11 07:32:35 geuzaine Exp $
+// $Id: Opengl.cpp,v 1.11 2001-01-11 12:25:23 geuzaine Exp $
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -43,10 +43,11 @@ void DrawUI(void){
   WID->check();
 }
 
-// one should not call Opengl_Window::draw() from the handle(), but
+// Opengl_Window::draw() from the handle(), but
 // rather the following:
 
 void DrawUpdate(){
+  if(!CTX.expose) return ;
   WID->make_current();
   Orthogonalize(0,0);
   glClearColor(UNPACK_RED(CTX.color.bg)/255.,
@@ -114,6 +115,7 @@ int SelectEntity(int type, Vertex **v, Curve **c, Surface **s){
 
   *v = NULL; *c = NULL; *s = NULL;
   
+  WID->try_selection = 0;
   WID->quit_selection = 0;
   WID->end_selection = 0;
   
@@ -127,7 +129,8 @@ int SelectEntity(int type, Vertex **v, Curve **c, Surface **s){
       WID->end_selection = 0;
       return -1;
     }
-    if(Fl::event_is_click()){
+    if(WID->try_selection){
+      WID->try_selection = 0;
       Process_SelectionBuffer(Fl::event_x(), Fl::event_y(), &hits, ii, jj);
       Filter_SelectionBuffer(hits,ii,jj,v,c,s,&M);
       if(check_type(type,*v,*c,*s)){
diff --git a/Fltk/Opengl_Window.cpp b/Fltk/Opengl_Window.cpp
index d898d6f3e0537606d8f31d6ec168d6a426a2df0a..e57f3fabe5291831d386b70380a815d807579dba 100644
--- a/Fltk/Opengl_Window.cpp
+++ b/Fltk/Opengl_Window.cpp
@@ -1,4 +1,4 @@
-// $Id: Opengl_Window.cpp,v 1.6 2001-01-10 21:35:08 geuzaine Exp $
+// $Id: Opengl_Window.cpp,v 1.7 2001-01-11 12:25:23 geuzaine Exp $
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -173,7 +173,10 @@ int Opengl_Window::handle(int event) {
         ZoomClick=0;
         clear_overlay();
         if(xb!=xe && yb!=ye) myZoom(xb,xe,yb,ye,xc1,xc2,yc1,yc2);
-      } 
+      }
+      else{
+	WID->try_selection = 1 ;
+      }
       break;
     case 2:
       if(Modifier && !ZoomClick){
@@ -313,15 +316,16 @@ int Opengl_Window::handle(int event) {
   case FL_MOVE:
     movx = Fl::event_x()-x;
     movy = Fl::event_y()-y;
+    WID->make_current();
     Process_SelectionBuffer(Fl::event_x(), Fl::event_y(), &hits, ii, jj);
     ov = v; oc = c; os = s; v = NULL; c = NULL; s = NULL;
     Filter_SelectionBuffer(hits,ii,jj,&v,&c,&s,&M);
 
-
-            BeginHighlight();
-            HighlightEntity(v,c,s,0);
-            EndHighlight(0);
-
+    if(ov != v || oc != c || os != s) { 
+      BeginHighlight();
+      HighlightEntity(v,c,s,0);
+      EndHighlight(0);
+    }
 
 #if 0
     // l'overlay ne marche pas, meme dans les demos de fltk!