]> git.saurik.com Git - wxWidgets.git/commitdiff
Disable Unity global menu while native modal dialogs are shown in wxGTK.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 21 Mar 2013 22:36:46 +0000 (22:36 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 21 Mar 2013 22:36:46 +0000 (22:36 +0000)
We need to use wxOpenModalDialogLocker even with native GTK+ dialogs to
prevent the menu commands from being available while they're shown, so do it
in wxMessageDialog and wxColourDialog which call gtk_dialog_run().

Closes #14823.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/colordlg.cpp
src/gtk/msgdlg.cpp

index 87b61d2d443e5b0c3decfef861039803549a9b65..b3a806d5b25d0a5d85e070e8c9c2102a664642fe 100644 (file)
@@ -28,6 +28,7 @@
 #include <gtk/gtk.h>
 #include "wx/gtk/private.h"
 #include "wx/gtk/private/gtk2-compat.h"
+#include "wx/gtk/private/dialogcount.h"
 
 #if wxUSE_LIBHILDON
     #include <hildon-widgets/hildon-color-selector.h>
@@ -87,6 +88,8 @@ int wxColourDialog::ShowModal()
 
     ColourDataToDialog();
 
+    wxOpenModalDialogLocker modalLocker;
+
     gint result = gtk_dialog_run(GTK_DIALOG(m_widget));
     gtk_widget_hide(m_widget);
 
index b01e51b13e95639306c7c1f508b4b20fc2fcc575..2c561dfca3caf56f7131b14856e965b4a4ce4c2d 100644 (file)
@@ -30,6 +30,7 @@
 #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 <hildon-widgets/hildon-note.h>
@@ -295,6 +296,8 @@ 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);