On Sun, May 08, 2011 at 10:01:01PM +0200, Matthias Melcher wrote: > > > * 2420 Tab-Navigation focuses non-active_r() widgets Core Library > Pending LOW
I posted an upgrade for the Fl_Tabs focus handling. This got never merged, although the focus problem described here still exists, and still gets fixed by this patch. It's probably not the same problem, but I think it's related. Kurt Date: Wed, 18 Nov 2009 13:42:17 +0100 Subject: [fltk.development] [PATCH] fix focus of Fl_Tabs children From: Kurt Van Dijck <[email protected]> To: [email protected] Hello, I'm new to this list. I found an issue with the current Fl_Tabs focus handling. My problematic scenario is this: a window with 1 Fl_Tabs with stuff in it, and 1 button. If I move focus to another window and back, the focus is _always_ moved to the 1 button, regardless the focused widget in the tabs. A major note here: I'm writing own widgets too. I fixed the behaviour by this modification. FYI: this was modified in r4358, with message: "Fl_Tabs would steal focus away from its children on a window focus change (STR #870)" The questioned patch lines were: - return 1; + if (Fl::event() == FL_FOCUS || Fl::event() == FL_UNFOCUS) return 0; + else return 1; I would suspect that before r4358, Fl_Tabs stealed focus. After my modification, Fl_Tabs would let Fl_Group handle focus events, instead of denying focus. I appreciate other opinions on this matter. Signed-off-by: Kurt Van Dijck <[email protected]> --- Index: src/Fl_Tabs.cxx =================================================================== --- src/Fl_Tabs.cxx (revision 6941) +++ src/Fl_Tabs.cxx (working copy) @@ -193,7 +193,8 @@ Fl::event() == FL_FOCUS || Fl::event() == FL_UNFOCUS) { redraw_tabs(); - if (Fl::event() == FL_FOCUS || Fl::event() == FL_UNFOCUS) return 0; + if (Fl::event() == FL_FOCUS || Fl::event() == FL_UNFOCUS) + return Fl_Group::handle(event); else return 1; } else return Fl_Group::handle(event); case FL_KEYBOARD: _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
