X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9dc44eff0235c5f30940f32ccc6d9d82a236e7d2..ad653fa23069c5d9378247084f03c9a718c3ad62:/src/gtk/msgdlg.cpp diff --git a/src/gtk/msgdlg.cpp b/src/gtk/msgdlg.cpp index e63c2e07f1..6d1104ae62 100644 --- a/src/gtk/msgdlg.cpp +++ b/src/gtk/msgdlg.cpp @@ -24,10 +24,13 @@ #include "wx/intl.h" #endif +#include "wx/modalhook.h" + #include #include "wx/gtk/private.h" #include "wx/gtk/private/messagetype.h" #include "wx/gtk/private/mnemonics.h" +#include "wx/gtk/private/dialogcount.h" #if wxUSE_LIBHILDON #include @@ -166,19 +169,13 @@ void wxMessageDialog::GTKCreateMsgDialog() } wxString message; -#if GTK_CHECK_VERSION(2, 6, 0) bool needsExtMessage = false; - if (!m_extendedMessage.empty() -#ifndef __WXGTK3__ - && gtk_check_version(2, 6, 0) == NULL -#endif - ) + if (!m_extendedMessage.empty()) { message = m_message; needsExtMessage = true; } - else // extended message not needed or not supported -#endif // GTK+ 2.6+ + else // extended message not needed { message = GetFullMessage(); } @@ -190,7 +187,6 @@ void wxMessageDialog::GTKCreateMsgDialog() "%s", (const char*)wxGTK_CONV(message)); -#if GTK_CHECK_VERSION(2, 6, 0) if ( needsExtMessage ) { gtk_message_dialog_format_secondary_text @@ -200,7 +196,6 @@ void wxMessageDialog::GTKCreateMsgDialog() (const char *)wxGTK_CONV(m_extendedMessage) ); } -#endif // GTK+ 2.6+ #endif // wxUSE_LIBHILDON || wxUSE_LIBHILDON2/!wxUSE_LIBHILDON && !wxUSE_LIBHILDON2 g_object_ref(m_widget); @@ -281,6 +276,8 @@ void wxMessageDialog::GTKCreateMsgDialog() int wxMessageDialog::ShowModal() { + WX_HOOK_MODAL_DIALOG(); + // break the mouse capture as it would interfere with modal dialog (see // wxDialog::ShowModal) wxWindow * const win = wxWindow::GetCapture(); @@ -299,7 +296,10 @@ int wxMessageDialog::ShowModal() if (m_parent) gtk_window_present( GTK_WINDOW(m_parent->m_widget) ); + wxOpenModalDialogLocker modalLocker; + gint result = gtk_dialog_run(GTK_DIALOG(m_widget)); + GTKDisconnect(m_widget); gtk_widget_destroy(m_widget); g_object_unref(m_widget); m_widget = NULL;