LOL i am correct and the systems are way different.
Win32 has PeekMessage() and so does Xlib, but Win32 returns 0 and stops where Xlib blocks and waits for the next message to occure.
So to get the same effect as Win32 we must use something like:
PHP Code:
int ProcessQueue()
{
#ifdef WIN32
MSG message;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) > 0)
{
if (MSG.message == WM_QUIT) { return 0; }
TranslateMessage(&message);
DispatchMessage(&message);
}
#else
XEvent message;
while (XEventsQueued(display_connect_id, QueuedAfterReading))
{
XNextEvent(display_connect_id, &message);
MyMessageHandler(message);
}
return 1; // all messages handled
#endif
}
just my $0.02