aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dw/fltkviewport.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/dw/fltkviewport.cc b/dw/fltkviewport.cc
index dd779a8f..aa1e8120 100644
--- a/dw/fltkviewport.cc
+++ b/dw/fltkviewport.cc
@@ -236,11 +236,20 @@ int FltkViewport::handle (int event)
case ::fltk::FOCUS:
/** \bug Draw focus box. */
- return 1;
+
+ /* If the user clicks with the left button we take focus
+ * and thereby unfocus any form widgets.
+ * Otherwise we let fltk do the focus handling.
+ */
+ if (::fltk::event_button() == ::fltk::LeftButton) {
+ set_focus(this);
+ return 1;
+ }
+ break;
case ::fltk::UNFOCUS:
/** \bug Undraw focus box. */
- return 1;
+ break;
case ::fltk::PUSH:
take_focus();