changeset 1674:f9c22caddf71

avoid automatic focus of first child when window gets focus
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Mon, 10 May 2010 06:55:56 +0200
parents cde7dddff1e7
children 20e683b693c0
files dw/fltkviewport.cc
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dw/fltkviewport.cc	Mon May 10 05:19:21 2010 +0200
+++ b/dw/fltkviewport.cc	Mon May 10 06:55:56 2010 +0200
@@ -241,8 +241,8 @@
        * and thereby unfocus any form widgets.
        * Otherwise we let fltk do the focus handling.
        */
-      if (::fltk::event_button() == ::fltk::LeftButton) {
-         set_focus(this);
+      if (::fltk::event_button() == ::fltk::LeftButton || focus_index() < 0) {
+         focus_index(-1);
          return 1;
       }
       break;