Author: manolo
Date: 2010-05-18 07:21:45 -0700 (Tue, 18 May 2010)
New Revision: 7611
Log:
Fixed "Unlock focus on wrong view" error that occurred sometimes.

Modified:
   branches/branch-1.3/src/Fl_cocoa.mm

Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2010-05-17 20:16:51 UTC (rev 7610)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2010-05-18 14:21:45 UTC (rev 7611)
@@ -2385,7 +2385,9 @@
     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;

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to