summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2010-05-18 14:21:45 +0000
committerManolo Gouy <Manolo>2010-05-18 14:21:45 +0000
commit347754de61e983a3fa39232b6e49d998071bb1a8 (patch)
tree8a672c56d228f6205ed741f52c8e1cb5db066d59 /src
parentf0be902828479b806ef28cb2ee9b81aa9cfff015 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 6a9654f75..33dda8694 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -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;