From f088e583a173cfd6cd80df7719a1a7ce9324ca2e Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Fri, 25 Mar 2011 12:31:51 +0000 Subject: Fix 2nd issue of STR #2594: Fl::focus() now informs Mac OS when the focus changes window. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8533 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Fl.cxx b/src/Fl.cxx index 96fdb4db4..a5b3061ce 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -816,7 +816,12 @@ void Fl::focus(Fl_Widget *o) { Fl_Window *win = 0, *w1 = o->as_window(); if (!w1) w1 = o->window(); while (w1) { win=w1; w1=win->window(); } - if (win) fl_xfocus = win; + if (win) { +#ifdef __APPLE__ + if (fl_xfocus != win) Fl_X::i(win)->set_key_window(); +#endif + fl_xfocus = win; + } } // take focus from the old focused window fl_oldfocus = 0; -- cgit v1.2.3