From db7af2b2b01f0bbae79bde6ff9f9b7ac2e7fdc40 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Tue, 4 Jun 2013 11:32:30 +0000
Subject: [PATCH] test focus

---
 Fltk/FlGui.cpp       | 1 -
 Fltk/onelabGroup.cpp | 6 ++++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Fltk/FlGui.cpp b/Fltk/FlGui.cpp
index fee6ad9a2b..5d00b3fd3a 100644
--- a/Fltk/FlGui.cpp
+++ b/Fltk/FlGui.cpp
@@ -314,7 +314,6 @@ FlGui::FlGui(int argc, char **argv)
 
   // graphic window should have the initial focus (so we can e.g. directly loop
   // through time steps with the keyboard)
-  //graph[0]->gl[0]->take_focus();
   Fl::focus(graph[0]->gl[0]);
 
   // get onelab tree group (FIXME: should clean this up)
diff --git a/Fltk/onelabGroup.cpp b/Fltk/onelabGroup.cpp
index 39b2846250..e44d168dcc 100644
--- a/Fltk/onelabGroup.cpp
+++ b/Fltk/onelabGroup.cpp
@@ -1573,8 +1573,10 @@ void onelabGroup::rebuildTree(bool deleteWidgets)
     delStrings = _treeStrings;
     _treeWidgets.clear();
     _treeStrings.clear();
-    // make sure we remove the focus from any widget that will be deleted
-    _tree->take_focus();
+    // make sure we remove the focus from any widget that will be deleted; not
+    // sure if this is still necessary; if it is, we should only do it if the
+    // focus is not in the graphical window:
+    // _tree->take_focus();
   }
 
   _addGmshMenus();
-- 
GitLab