]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/app.cpp
call Show(false) from ~wxDialog to call EndModal if the dialog is still modal consist...
[wxWidgets.git] / src / gtk / app.cpp
index f530f0998c8c34894c98307aeb77bbd6ee6eb82c..138f2eac56d6fb0bace87a7def1709c80f6acd92 100644 (file)
@@ -48,8 +48,6 @@
 // global data
 //-----------------------------------------------------------------------------
 
-bool   g_mainThreadLocked = false;
-
 static GtkWidget *gs_RootWindow = (GtkWidget*) NULL;
 
 //-----------------------------------------------------------------------------
@@ -218,31 +216,6 @@ bool wxApp::DoIdle()
     return false;
 }
 
-#if wxUSE_THREADS
-
-static GPollFunc wxgs_poll_func;
-
-extern "C" {
-static gint wxapp_poll_func( GPollFD *ufds, guint nfds, gint timeout )
-{
-    gdk_threads_enter();
-
-    wxMutexGuiLeave();
-    g_mainThreadLocked = true;
-
-    gint res = (*wxgs_poll_func)(ufds, nfds, timeout);
-
-    wxMutexGuiEnter();
-    g_mainThreadLocked = false;
-
-    gdk_threads_leave();
-
-    return res;
-}
-}
-
-#endif // wxUSE_THREADS
-
 //-----------------------------------------------------------------------------
 // Access to the root window global
 //-----------------------------------------------------------------------------
@@ -356,10 +329,10 @@ bool wxApp::Initialize(int& argc_, wxChar **argv_)
 
 #if wxUSE_THREADS
     if (!g_thread_supported())
+    {
         g_thread_init(NULL);
-
-    wxgs_poll_func = g_main_context_get_poll_func(NULL);
-    g_main_context_set_poll_func(NULL, wxapp_poll_func);
+        gdk_threads_init();
+    }
 #endif // wxUSE_THREADS
 
     // We should have the wxUSE_WCHAR_T test on the _outside_
@@ -581,3 +554,15 @@ void wxApp::OnAssertFailure(const wxChar *file,
 }
 
 #endif // __WXDEBUG__
+
+#if wxUSE_THREADS
+void wxGUIAppTraits::MutexGuiEnter()
+{
+    gdk_threads_enter();
+}
+
+void wxGUIAppTraits::MutexGuiLeave()
+{
+    gdk_threads_leave();
+}
+#endif // wxUSE_THREADS