X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5b8a521e5993217b027e8045f0a211957cba945d..236a9de39afa090fdee3cf91cb5364ceca69e3f8:/src/gtk/dialog.cpp diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index fbc1793ea9..55d5e95511 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -59,7 +59,8 @@ bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED if (g_isIdle) wxapp_install_idle_handler(); - win->Close(); + if (win->IsEnabled()) + win->Close(); return TRUE; } @@ -266,8 +267,6 @@ bool wxDialog::Create( wxWindow *parent, const wxPoint &pos, const wxSize &size, long style, const wxString &name ) { - g_openDialogs++; - wxTopLevelWindows.Append( this ); m_needParent = FALSE; @@ -344,8 +343,6 @@ wxDialog::~wxDialog() { wxTheApp->ExitMainLoop(); } - - g_openDialogs--; } void wxDialog::SetTitle( const wxString& title ) @@ -630,10 +627,14 @@ int wxDialog::ShowModal() m_modalShowing = TRUE; + g_openDialogs++; + gtk_grab_add( m_widget ); gtk_main(); gtk_grab_remove( m_widget ); + g_openDialogs--; + return GetReturnCode(); }