Fixed crash on Mac OS when Fl::focus() called before show().

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8577 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2011-04-11 20:10:02 +00:00
parent 8d084cb4bc
commit 87b998ed1f

View File

@ -847,7 +847,10 @@ void Fl::focus(Fl_Widget *o) {
while (w1) { win=w1; w1=win->window(); }
if (win) {
#ifdef __APPLE__
if (fl_xfocus != win) Fl_X::i(win)->set_key_window();
if (fl_xfocus != win) {
Fl_X *x = Fl_X::i(win);
if (x) x->set_key_window();
}
#endif
fl_xfocus = win;
}