From 64c11164f0a9ed48a69d0ef3f77ae03e11671394 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 17 Nov 2007 20:50:44 +0000 Subject: [PATCH] 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 --- src/gtk/dialog.cpp | 12 ++++-------- src/gtk/toplevel.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index dc66c23778..fe9a0036c2 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -20,12 +20,8 @@ #include -//----------------------------------------------------------------------------- -// 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(); } diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index caca06176d..89a5791978 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -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(); -- 2.47.2