-
-#if (GTK_MINOR_VERSION > 0)
- /* release lock again */
- GDK_THREADS_LEAVE ();
-#endif
-
- wxTheApp->m_wakeUpTimerTag = gtk_timeout_add( 20, wxapp_wakeup_timerout_callback, (gpointer) NULL );
-
- return TRUE;
+ g_mainThreadLocked = FALSE;
+
+ gdk_threads_leave();
+
+ return res;
+}
+
+#endif // wxUSE_THREADS
+
+} // extern "C"
+
+void wxapp_install_idle_handler()
+{
+ wxASSERT_MSG( wxTheApp->m_idleTag == 0, wxT("attempt to install idle handler twice") );
+
+ g_isIdle = FALSE;
+
+ if (g_pendingTag == 0)
+ g_pendingTag = gtk_idle_add_priority( 900, wxapp_pending_callback, (gpointer) NULL );
+
+ // This routine gets called by all event handlers
+ // indicating that the idle is over. It may also
+ // get called from other thread for sending events
+ // to the main thread (and processing these in
+ // idle time). Very low priority.
+ wxTheApp->m_idleTag = gtk_idle_add_priority( 1000, wxapp_idle_callback, (gpointer) NULL );
+}
+
+//-----------------------------------------------------------------------------
+// Access to the root window global
+//-----------------------------------------------------------------------------
+
+GtkWidget* wxGetRootWindow()
+{
+ if (gs_RootWindow == NULL)
+ {
+ gs_RootWindow = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ gtk_widget_realize( gs_RootWindow );
+ }
+ return gs_RootWindow;