git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50034
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
-//-----------------------------------------------------------------------------
-// global data
-//-----------------------------------------------------------------------------
-
-// Don't allow window closing if there are open dialogs
-int g_openDialogs;
+// this is defined in src/gtk/toplevel.cpp
+extern int wxOpenModalDialogsCount;
//-----------------------------------------------------------------------------
// wxDialog
//-----------------------------------------------------------------------------
// wxDialog
+ wxOpenModalDialogsCount++;
// NOTE: gtk_window_set_modal internally calls gtk_grab_add() !
gtk_window_set_modal(GTK_WINDOW(m_widget), TRUE);
// NOTE: gtk_window_set_modal internally calls gtk_grab_add() !
gtk_window_set_modal(GTK_WINDOW(m_widget), TRUE);
gtk_window_set_modal(GTK_WINDOW(m_widget), FALSE);
gtk_window_set_modal(GTK_WINDOW(m_widget), FALSE);
+ wxOpenModalDialogsCount--;
return GetReturnCode();
}
return GetReturnCode();
}
// data
// ----------------------------------------------------------------------------
// data
// ----------------------------------------------------------------------------
-extern int g_openDialogs;
+// this is incremented while a modal dialog is shown
+int wxOpenModalDialogsCount = 0;
+
extern wxWindowGTK *g_delayedFocus;
// the frame that is currently active (i.e. its child has focus). It is
extern wxWindowGTK *g_delayedFocus;
// the frame that is currently active (i.e. its child has focus). It is
wxTopLevelWindowGTK *win )
{
if (win->IsEnabled() &&
wxTopLevelWindowGTK *win )
{
if (win->IsEnabled() &&
- (g_openDialogs == 0 || (win->GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) ||
+ (wxOpenModalDialogsCount == 0 || (win->GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) ||
win->IsGrabbed()))
win->Close();
win->IsGrabbed()))
win->Close();