Before deleting a window, it's better to check whether it contains the currently focused NSView,

and unlock focus there.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9026 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2011-09-02 12:15:43 +00:00
parent e758e6aac2
commit 21ddc8900c

View File

@ -2625,7 +2625,11 @@ void Fl_X::relink(Fl_Window *w, Fl_Window *wp) {
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];
}
}