On Sunday, March 8, 2015 at 10:09:33 AM UTC-4, Bram Moolenaar wrote: > Hmm, strange. I had always thought, and the man page seems to suggest > this as well, that when XtAppPending() returns non-zero, then > XtAppNextEvent() will get the next event. The manual is unclear, but > perhaps an XtIMTimer event is handled inside XtAppPending() and then it > blocks on waiting for another event?
I think that XtAppNextEvent will handle XtIMTimer events, but it won't return until it gets an XtIMXEvent. If you put a printf statement that shows the mask you can see that everything runs fine while it has a mask of 0 or 1 (XtIMXEvent), but when we get 2 (XtIMTimer) everything stops on XtAppNextEvent because it wants an XtIMXEvent before it returns. >From this link, >https://groups.google.com/forum/#!topic/comp.windows.x.motif/kD56Irjd8Tk >> The problem is, if an XtTimeOut triggers, XtAppPending() returns true >> but XtAppNextEvent() blocks, because there really is no event, but >> since XtAppNextEvent() handles timers (and workprocs), XtAppPending() has >> to return true if a timer happens. >> Now XtAppNextEvent() is blocking, waiting for an event that never comes, I then basically copied his solution. > After your change, wouldn't XtIMTimer events be sitting in the queue > until a character is typed? Everything up to the conditional for the bitmask should work exactly the same. When we get an XtIMXEvent we continue the old way. If we have an XtIMTimer event we just call XtAppProcessEvent which from the manpage, "The XtAppProcessEvent function processes one timer, alternate input, signal source, or X event. " So it should handle the XtIMTimer event then return. ---- Aaron Burrow -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
