Fixed "Unlock focus on wrong view" error that occurred sometimes.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7611 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2010-05-18 14:21:45 +00:00
parent f0be902828
commit 347754de61

View File

@ -2385,7 +2385,9 @@ void Fl_Window::make_current()
win = (Fl_Window*)win->window();
}
[[NSView focusView] unlockFocus];
NSView *current_focus = [NSView focusView];
// sometimes current_focus is set to a non-FLTK view: don't touch that
if ( [current_focus isKindOfClass:[FLView class]] ) [current_focus unlockFocus];
[[(NSWindow*)i->xid contentView] lockFocus];
i->gc = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
fl_gc = i->gc;