if ( gs_mouseCapture == this )
ReleaseMouse();
+
if (gs_activeFrame == this)
- gs_activeFrame = NULL;
+ {
+ gs_activeFrame = NULL;
+ // activate next frame in Z-order:
+ if ( m_wnd->prev )
+ {
+ wxWindowMGL *win = (wxWindowMGL*)m_wnd->prev->userData;
+ win->SetFocus();
+ }
+ }
+
if ( gs_focusedWindow == this )
KillFocus();
+
if ( gs_windowUnderMouse == this )
gs_windowUnderMouse = NULL;
return FALSE;
MGL_wmShowWindow(m_wnd, show);
+
+ if (!show && gs_activeFrame == this)
+ {
+ // activate next frame in Z-order:
+ if ( m_wnd->prev )
+ {
+ wxWindowMGL *win = (wxWindowMGL*)m_wnd->prev->userData;
+ win->SetFocus();
+ }
+ }
+
return TRUE;
}