Author: manolo
Date: 2011-09-02 05:15:43 -0700 (Fri, 02 Sep 2011)
New Revision: 9026
Log:
Before deleting a window, it's better to check whether it contains the 
currently focused NSView,
and unlock focus there.

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 2011-09-01 20:14:26 UTC (rev 9025)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2011-09-02 12:15:43 UTC (rev 9026)
@@ -2625,7 +2625,11 @@
 void Fl_X::destroy() {
   // subwindows share their xid with their parent window, so should not close 
it
   if (!subwindow && w && !w->parent() && xid) {
-    [[(NSWindow *)xid contentView] release];
+    NSView *topview = [(NSWindow *)xid contentView]; 
+    if ( [NSView focusView] == topview ) {
+      [topview unlockFocus];
+    }
+    [topview release];
     [(NSWindow *)xid close];
   }
 }

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

Reply via email to