X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/02d5015b1cbb99d7a2e2ab7818cd46b2b4514957..79cb759dc8580da2e82e880cd94a08cd38bb814e:/src/gtk1/dialog.cpp diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp index 5a1129b0e2..540910d9dc 100644 --- a/src/gtk1/dialog.cpp +++ b/src/gtk1/dialog.cpp @@ -141,7 +141,7 @@ void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); cancelEvent.SetEventObject( this ); - GetEventHandler()->ProcessEvent(cancelEvent); + HandleWindowEvent(cancelEvent); s_closing.DeleteObject(this); } @@ -162,6 +162,9 @@ bool wxDialog::Show( bool show ) GtkOnSize( m_x, m_y, m_width, m_height ); } + if (show && CanDoLayoutAdaptation()) + DoLayoutAdaptation(); + bool ret = wxWindow::Show( show ); if (show) InitDialog(); @@ -191,11 +194,8 @@ int wxDialog::ShowModal() // forbidden if ( !GetParent() && !(GetWindowStyleFlag() & wxDIALOG_NO_PARENT) ) { - wxWindow *parent = wxTheApp->GetTopWindow(); - if ( parent && - parent != this && - !parent->IsBeingDeleted() && - !(parent->GetExtraStyle() & wxWS_EX_TRANSIENT) ) + wxWindow * const parent = GetParentForModalDialog(); + if ( parent ) { m_parent = parent; gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(parent->m_widget) );