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
This commit is contained in:
Manolo Gouy 2011-03-25 12:31:51 +00:00
parent f8b645f614
commit f088e583a1

View File

@ -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;