FLTK logo

[Library] r9026 - branches/branch-1.3/src

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Library      Forums      Links      Apps     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[Library] r9026 - branches/branch-1.3/src fltk-dev Sep 02, 2011  
 
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];
   }
 }

Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.