#include "wx/dialog.h"
#include "wx/frame.h"
#include "wx/app.h"
+
+#include "gdk/gdk.h"
+#include "gtk/gtk.h"
#include "wx/gtk/win_gtk.h"
//-----------------------------------------------------------------------------
wxDialog::~wxDialog()
{
wxTopLevelWindows.DeleteObject( this );
- if (wxTopLevelWindows.Number() == 0) wxTheApp->ExitMainLoop();
+
+ if (wxTheApp->GetTopWindow() == this)
+ {
+ wxTheApp->SetTopWindow( (wxWindow*) NULL );
+ }
+
+ if (wxTopLevelWindows.Number() == 0)
+ {
+ wxTheApp->ExitMainLoop();
+ }
}
void wxDialog::SetTitle( const wxString& title )