// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "evtloop.h"
#endif
static bool SendIdleMessage()
{
- wxIdleEvent event;
-
- return wxTheApp->ProcessEvent(event) && event.MoreRequested();
+ return wxTheApp->ProcessIdle();
}
bool wxEventLoopImpl::SendIdleMessage()
* window is recieved. Prevents flicker as windows are resized.
*/
- Display *disp = XtDisplay((Widget) wxTheApp->GetTopLevelWidget());
+ Display *disp = event->xany.display;
Window win = event->xany.window;
XEvent report;
{
// Find a wxWindow for this window
// TODO: should get display for the window, not the current display
- Widget widget = XtWindowToWidget((Display*) wxGetDisplay(),
+ Widget widget = XtWindowToWidget(event->xany.display,
event->xany.window);
wxWindow* win = NULL;
{
if (event->xany.type == KeyPress)
{
- Widget widget = XtWindowToWidget((Display*) wxGetDisplay(),
- event->xany.window);
+ Widget widget = XtWindowToWidget(event->xany.display,
+ event->xany.window);
wxWindow* win = NULL;
// Find the first wxWindow that corresponds to this event window
{
if (event->xany.type == KeyRelease)
{
- Widget widget = XtWindowToWidget((Display*) wxGetDisplay(),
- event->xany.window);
+ Widget widget = XtWindowToWidget(event->xany.display,
+ event->xany.window);
wxWindow* win = NULL;
// Find the first wxWindow that corresponds to this event window
virtual bool OnInit()
{
+ // Must be done before modules are initialized
+#if 0
if( pipe(idleFds) != 0 )
return false;
-
+#endif
return true;
}
write( idleFds[1], &dummy, 1 );
}
-void wxWakeUpIdle()
+void wxApp::WakeUpIdle()
{
::wxBreakDispatch();
}
+bool wxInitIdleFds()
+{
+ if( pipe(idleFds) != 0 )
+ return false;
+ return true;
+}
+
bool wxAddIdleCallback()
{
+ if (!wxInitIdleFds())
+ return false;
+
// install input handler for wxWakeUpIdle
inputId = XtAppAddInput( (XtAppContext) wxTheApp->GetAppContext(),
idleFds[0],