rename g_openDialogs to wxOpenModalDialogsCount and define it in toplevel.cpp to fix wxUniv/GTK linking issues
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50034 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -20,12 +20,8 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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
|
||||
@@ -120,7 +116,7 @@ int wxDialog::ShowModal()
|
||||
|
||||
m_modalShowing = true;
|
||||
|
||||
g_openDialogs++;
|
||||
wxOpenModalDialogsCount++;
|
||||
|
||||
// NOTE: gtk_window_set_modal internally calls gtk_grab_add() !
|
||||
gtk_window_set_modal(GTK_WINDOW(m_widget), TRUE);
|
||||
@@ -129,7 +125,7 @@ int wxDialog::ShowModal()
|
||||
|
||||
gtk_window_set_modal(GTK_WINDOW(m_widget), FALSE);
|
||||
|
||||
g_openDialogs--;
|
||||
wxOpenModalDialogsCount--;
|
||||
|
||||
return GetReturnCode();
|
||||
}
|
||||
|
@@ -54,7 +54,9 @@
|
||||
// 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
|
||||
@@ -275,7 +277,7 @@ gtk_frame_delete_callback( GtkWidget *WXUNUSED(widget),
|
||||
wxTopLevelWindowGTK *win )
|
||||
{
|
||||
if (win->IsEnabled() &&
|
||||
(g_openDialogs == 0 || (win->GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) ||
|
||||
(wxOpenModalDialogsCount == 0 || (win->GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) ||
|
||||
win->IsGrabbed()))
|
||||
win->Close();
|
||||
|
||||
|
Reference in New Issue
Block a user