wxFORCE_LINK_MODULE(gnome_vfs)
#endif
-//-----------------------------------------------------------------------------
-// global data
-//-----------------------------------------------------------------------------
-
-static GtkWidget *gs_RootWindow = (GtkWidget*) NULL;
-
-//-----------------------------------------------------------------------------
-// wxYield
-//-----------------------------------------------------------------------------
-
-// not static because used by textctrl.cpp
-//
-// MT-FIXME
-bool wxIsInsideYield = false;
-
-bool wxApp::Yield(bool onlyIfNeeded)
-{
- if ( wxIsInsideYield )
- {
- if ( !onlyIfNeeded )
- {
- wxFAIL_MSG( wxT("wxYield called recursively" ) );
- }
-
- return false;
- }
-
-#if wxUSE_THREADS
- if ( !wxThread::IsMain() )
- {
- // can't call gtk_main_iteration() from other threads like this
- return true;
- }
-#endif // wxUSE_THREADS
-
- wxIsInsideYield = true;
-
-#if wxUSE_LOG
- // disable log flushing from here because a call to wxYield() shouldn't
- // normally result in message boxes popping up &c
- wxLog::Suspend();
-#endif
-
- while (EventsPending())
- gtk_main_iteration();
-
- // It's necessary to call ProcessIdle() to update the frames sizes which
- // might have been changed (it also will update other things set from
- // OnUpdateUI() which is a nice (and desired) side effect). But we
- // call ProcessIdle() only once since this is not meant for longish
- // background jobs (controlled by wxIdleEvent::RequestMore() and the
- // return value of Processidle().
- ProcessIdle();
-
-#if wxUSE_LOG
- // let the logs be flashed again
- wxLog::Resume();
-#endif
-
- wxIsInsideYield = false;
-
- return true;
-}
-
//-----------------------------------------------------------------------------
// local functions
//-----------------------------------------------------------------------------
g_source_remove(m_idleSourceId);
m_idleSourceId = 0;
}
+
+ // Pending events can be added asynchronously,
+ // need to keep idle source if any have appeared
+ needMore = needMore || HasPendingEvents();
+
// if more idle processing requested
if (needMore)
{
GtkWidget* wxGetRootWindow()
{
- if (gs_RootWindow == NULL)
+ static GtkWidget *s_RootWindow = NULL;
+
+ if (s_RootWindow == NULL)
{
- gs_RootWindow = gtk_window_new( GTK_WINDOW_TOPLEVEL );
- gtk_widget_realize( gs_RootWindow );
+ s_RootWindow = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+ gtk_widget_realize( s_RootWindow );
}
- return gs_RootWindow;
+ return s_RootWindow;
}
//-----------------------------------------------------------------------------
}
#endif // wxUSE_THREADS
- // We should have the wxUSE_WCHAR_T test on the _outside_
-#if wxUSE_WCHAR_T
// gtk+ 2.0 supports Unicode through UTF-8 strings
wxConvCurrent = &wxConvUTF8;
-#else // !wxUSE_WCHAR_T
- if (!wxOKlibc())
- wxConvCurrent = (wxMBConv*) NULL;
-#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
// decide which conversion to use for the file names
}
argc_ = argcGTK;
+ argv_[argc_] = NULL;
}
//else: gtk_init() didn't modify our parameters