Mercurial > vim
changeset 6683:781104cb0d06 v7.4.666
updated for version 7.4.666
Problem: There is a chance that Vim may lock up.
Solution: Handle timer events differently. (Aaron Burrow)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 20 Mar 2015 16:26:54 +0100 |
parents | 28bb3ecefb52 |
children | f801bd0355bf |
files | src/os_unix.c src/version.c |
diffstat | 2 files changed, 26 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/os_unix.c +++ b/src/os_unix.c @@ -7096,19 +7096,33 @@ xterm_update() { XEvent event; - while (XtAppPending(app_context) && !vim_is_input_buf_full()) + for (;;) { - XtAppNextEvent(app_context, &event); -#ifdef FEAT_CLIENTSERVER + XtInputMask mask = XtAppPending(app_context); + + if (mask == 0 || vim_is_input_buf_full()) + break; + + if (mask & XtIMXEvent) { - XPropertyEvent *e = (XPropertyEvent *)&event; - - if (e->type == PropertyNotify && e->window == commWindow + /* There is an event to process. */ + XtAppNextEvent(app_context, &event); +#ifdef FEAT_CLIENTSERVER + { + XPropertyEvent *e = (XPropertyEvent *)&event; + + if (e->type == PropertyNotify && e->window == commWindow && e->atom == commProperty && e->state == PropertyNewValue) - serverEventProc(xterm_dpy, &event); - } -#endif - XtDispatchEvent(&event); + serverEventProc(xterm_dpy, &event); + } +#endif + XtDispatchEvent(&event); + } + else + { + /* There is something else than an event to process. */ + XtAppProcessEvent(app_context, mask); + } } }