Create a small helper class for Unity global menu bug workaround.
Encapsulate the code temporarily incrementing wxOpenModalDialogsCount in a small helper class to make it easier to reuse it elsewhere. See #14823. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -23,9 +23,7 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "wx/gtk/private/gtk2-compat.h"
|
||||
|
||||
// this is defined in src/gtk/toplevel.cpp
|
||||
extern int wxOpenModalDialogsCount;
|
||||
#include "wx/gtk/private/dialogcount.h"
|
||||
|
||||
wxDEFINE_TIED_SCOPED_PTR_TYPE(wxGUIEventLoop)
|
||||
|
||||
@@ -172,7 +170,7 @@ int wxDialog::ShowModal()
|
||||
|
||||
m_modalShowing = true;
|
||||
|
||||
wxOpenModalDialogsCount++;
|
||||
wxOpenModalDialogLocker modalLock;
|
||||
|
||||
// NOTE: gtk_window_set_modal internally calls gtk_grab_add() !
|
||||
gtk_window_set_modal(GTK_WINDOW(m_widget), TRUE);
|
||||
@@ -190,8 +188,6 @@ int wxDialog::ShowModal()
|
||||
|
||||
gtk_window_set_modal(GTK_WINDOW(m_widget), FALSE);
|
||||
|
||||
wxOpenModalDialogsCount--;
|
||||
|
||||
return GetReturnCode();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user