|
Karsten Hopp |
9a4b3f |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
9a4b3f |
Subject: Patch 7.3.595
|
|
Karsten Hopp |
9a4b3f |
Fcc: outbox
|
|
Karsten Hopp |
9a4b3f |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
9a4b3f |
Mime-Version: 1.0
|
|
Karsten Hopp |
9a4b3f |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
9a4b3f |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
9a4b3f |
------------
|
|
Karsten Hopp |
9a4b3f |
|
|
Karsten Hopp |
9a4b3f |
Patch 7.3.595
|
|
Karsten Hopp |
9a4b3f |
Problem: The X command server responds slowly
|
|
Karsten Hopp |
9a4b3f |
Solution: Change the loop that waits for replies. (Brian Burns)
|
|
Karsten Hopp |
9a4b3f |
Files: src/if_xcmdsrv.c
|
|
Karsten Hopp |
9a4b3f |
|
|
Karsten Hopp |
9a4b3f |
|
|
Karsten Hopp |
9a4b3f |
*** ../vim-7.3.594/src/if_xcmdsrv.c 2012-07-10 14:25:00.000000000 +0200
|
|
Karsten Hopp |
9a4b3f |
--- src/if_xcmdsrv.c 2012-07-10 14:44:13.000000000 +0200
|
|
Karsten Hopp |
9a4b3f |
***************
|
|
Karsten Hopp |
9a4b3f |
*** 572,632 ****
|
|
Karsten Hopp |
9a4b3f |
{
|
|
Karsten Hopp |
9a4b3f |
time_t start;
|
|
Karsten Hopp |
9a4b3f |
time_t now;
|
|
Karsten Hopp |
9a4b3f |
- time_t lastChk = 0;
|
|
Karsten Hopp |
9a4b3f |
XEvent event;
|
|
Karsten Hopp |
9a4b3f |
! XPropertyEvent *e = (XPropertyEvent *)&event;
|
|
Karsten Hopp |
9a4b3f |
! # define SEND_MSEC_POLL 50
|
|
Karsten Hopp |
9a4b3f |
|
|
Karsten Hopp |
9a4b3f |
time(&start;;
|
|
Karsten Hopp |
9a4b3f |
! while (endCond(endData) == 0)
|
|
Karsten Hopp |
9a4b3f |
{
|
|
Karsten Hopp |
9a4b3f |
time(&now;;
|
|
Karsten Hopp |
9a4b3f |
if (seconds >= 0 && (now - start) >= seconds)
|
|
Karsten Hopp |
9a4b3f |
break;
|
|
Karsten Hopp |
9a4b3f |
! if (now != lastChk)
|
|
Karsten Hopp |
9a4b3f |
! {
|
|
Karsten Hopp |
9a4b3f |
! lastChk = now;
|
|
Karsten Hopp |
9a4b3f |
! if (!WindowValid(dpy, w))
|
|
Karsten Hopp |
9a4b3f |
! break;
|
|
Karsten Hopp |
9a4b3f |
! /*
|
|
Karsten Hopp |
9a4b3f |
! * Sometimes the PropertyChange event doesn't come.
|
|
Karsten Hopp |
9a4b3f |
! * This can be seen in eg: vim -c 'echo remote_expr("gvim", "3+2")'
|
|
Karsten Hopp |
9a4b3f |
! */
|
|
Karsten Hopp |
9a4b3f |
! serverEventProc(dpy, NULL);
|
|
Karsten Hopp |
9a4b3f |
! }
|
|
Karsten Hopp |
9a4b3f |
if (localLoop)
|
|
Karsten Hopp |
9a4b3f |
{
|
|
Karsten Hopp |
9a4b3f |
- /* Just look out for the answer without calling back into Vim */
|
|
Karsten Hopp |
9a4b3f |
#ifndef HAVE_SELECT
|
|
Karsten Hopp |
9a4b3f |
- struct pollfd fds;
|
|
Karsten Hopp |
9a4b3f |
-
|
|
Karsten Hopp |
9a4b3f |
- fds.fd = ConnectionNumber(dpy);
|
|
Karsten Hopp |
9a4b3f |
- fds.events = POLLIN;
|
|
Karsten Hopp |
9a4b3f |
if (poll(&fds, 1, SEND_MSEC_POLL) < 0)
|
|
Karsten Hopp |
9a4b3f |
break;
|
|
Karsten Hopp |
9a4b3f |
#else
|
|
Karsten Hopp |
9a4b3f |
! fd_set fds;
|
|
Karsten Hopp |
9a4b3f |
! struct timeval tv;
|
|
Karsten Hopp |
9a4b3f |
!
|
|
Karsten Hopp |
9a4b3f |
! tv.tv_sec = 0;
|
|
Karsten Hopp |
9a4b3f |
! tv.tv_usec = SEND_MSEC_POLL * 1000;
|
|
Karsten Hopp |
9a4b3f |
! FD_ZERO(&fds);
|
|
Karsten Hopp |
9a4b3f |
! FD_SET(ConnectionNumber(dpy), &fds);
|
|
Karsten Hopp |
9a4b3f |
! if (select(ConnectionNumber(dpy) + 1, &fds, NULL, NULL, &tv) < 0)
|
|
Karsten Hopp |
9a4b3f |
break;
|
|
Karsten Hopp |
9a4b3f |
#endif
|
|
Karsten Hopp |
9a4b3f |
- while (XEventsQueued(dpy, QueuedAfterReading) > 0)
|
|
Karsten Hopp |
9a4b3f |
- {
|
|
Karsten Hopp |
9a4b3f |
- XNextEvent(dpy, &event);
|
|
Karsten Hopp |
9a4b3f |
- if (event.type == PropertyNotify && e->window == commWindow)
|
|
Karsten Hopp |
9a4b3f |
- serverEventProc(dpy, &event);
|
|
Karsten Hopp |
9a4b3f |
- }
|
|
Karsten Hopp |
9a4b3f |
}
|
|
Karsten Hopp |
9a4b3f |
else
|
|
Karsten Hopp |
9a4b3f |
{
|
|
Karsten Hopp |
9a4b3f |
if (got_int)
|
|
Karsten Hopp |
9a4b3f |
break;
|
|
Karsten Hopp |
9a4b3f |
! ui_delay((long)SEND_MSEC_POLL, TRUE);
|
|
Karsten Hopp |
9a4b3f |
ui_breakcheck();
|
|
Karsten Hopp |
9a4b3f |
}
|
|
Karsten Hopp |
9a4b3f |
}
|
|
Karsten Hopp |
9a4b3f |
--- 572,626 ----
|
|
Karsten Hopp |
9a4b3f |
{
|
|
Karsten Hopp |
9a4b3f |
time_t start;
|
|
Karsten Hopp |
9a4b3f |
time_t now;
|
|
Karsten Hopp |
9a4b3f |
XEvent event;
|
|
Karsten Hopp |
9a4b3f |
!
|
|
Karsten Hopp |
9a4b3f |
! #define UI_MSEC_DELAY 50
|
|
Karsten Hopp |
9a4b3f |
! #define SEND_MSEC_POLL 500
|
|
Karsten Hopp |
9a4b3f |
! #ifndef HAVE_SELECT
|
|
Karsten Hopp |
9a4b3f |
! struct pollfd fds;
|
|
Karsten Hopp |
9a4b3f |
!
|
|
Karsten Hopp |
9a4b3f |
! fds.fd = ConnectionNumber(dpy);
|
|
Karsten Hopp |
9a4b3f |
! fds.events = POLLIN;
|
|
Karsten Hopp |
9a4b3f |
! #else
|
|
Karsten Hopp |
9a4b3f |
! fd_set fds;
|
|
Karsten Hopp |
9a4b3f |
! struct timeval tv;
|
|
Karsten Hopp |
9a4b3f |
!
|
|
Karsten Hopp |
9a4b3f |
! tv.tv_sec = 0;
|
|
Karsten Hopp |
9a4b3f |
! tv.tv_usec = SEND_MSEC_POLL * 1000;
|
|
Karsten Hopp |
9a4b3f |
! FD_ZERO(&fds);
|
|
Karsten Hopp |
9a4b3f |
! FD_SET(ConnectionNumber(dpy), &fds);
|
|
Karsten Hopp |
9a4b3f |
! #endif
|
|
Karsten Hopp |
9a4b3f |
|
|
Karsten Hopp |
9a4b3f |
time(&start;;
|
|
Karsten Hopp |
9a4b3f |
! while (TRUE)
|
|
Karsten Hopp |
9a4b3f |
{
|
|
Karsten Hopp |
9a4b3f |
+ while (XCheckWindowEvent(dpy, commWindow, PropertyChangeMask, &event))
|
|
Karsten Hopp |
9a4b3f |
+ serverEventProc(dpy, &event);
|
|
Karsten Hopp |
9a4b3f |
+
|
|
Karsten Hopp |
9a4b3f |
+ if (endCond(endData) != 0)
|
|
Karsten Hopp |
9a4b3f |
+ break;
|
|
Karsten Hopp |
9a4b3f |
+ if (!WindowValid(dpy, w))
|
|
Karsten Hopp |
9a4b3f |
+ break;
|
|
Karsten Hopp |
9a4b3f |
time(&now;;
|
|
Karsten Hopp |
9a4b3f |
if (seconds >= 0 && (now - start) >= seconds)
|
|
Karsten Hopp |
9a4b3f |
break;
|
|
Karsten Hopp |
9a4b3f |
!
|
|
Karsten Hopp |
9a4b3f |
! /* Just look out for the answer without calling back into Vim */
|
|
Karsten Hopp |
9a4b3f |
if (localLoop)
|
|
Karsten Hopp |
9a4b3f |
{
|
|
Karsten Hopp |
9a4b3f |
#ifndef HAVE_SELECT
|
|
Karsten Hopp |
9a4b3f |
if (poll(&fds, 1, SEND_MSEC_POLL) < 0)
|
|
Karsten Hopp |
9a4b3f |
break;
|
|
Karsten Hopp |
9a4b3f |
#else
|
|
Karsten Hopp |
9a4b3f |
! if (select(FD_SETSIZE, &fds, NULL, NULL, &tv) < 0)
|
|
Karsten Hopp |
9a4b3f |
break;
|
|
Karsten Hopp |
9a4b3f |
#endif
|
|
Karsten Hopp |
9a4b3f |
}
|
|
Karsten Hopp |
9a4b3f |
else
|
|
Karsten Hopp |
9a4b3f |
{
|
|
Karsten Hopp |
9a4b3f |
if (got_int)
|
|
Karsten Hopp |
9a4b3f |
break;
|
|
Karsten Hopp |
9a4b3f |
! ui_delay((long)UI_MSEC_DELAY, TRUE);
|
|
Karsten Hopp |
9a4b3f |
ui_breakcheck();
|
|
Karsten Hopp |
9a4b3f |
}
|
|
Karsten Hopp |
9a4b3f |
}
|
|
Karsten Hopp |
9a4b3f |
*** ../vim-7.3.594/src/version.c 2012-07-10 14:25:00.000000000 +0200
|
|
Karsten Hopp |
9a4b3f |
--- src/version.c 2012-07-10 14:52:16.000000000 +0200
|
|
Karsten Hopp |
9a4b3f |
***************
|
|
Karsten Hopp |
9a4b3f |
*** 716,717 ****
|
|
Karsten Hopp |
9a4b3f |
--- 716,719 ----
|
|
Karsten Hopp |
9a4b3f |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
9a4b3f |
+ /**/
|
|
Karsten Hopp |
9a4b3f |
+ 595,
|
|
Karsten Hopp |
9a4b3f |
/**/
|
|
Karsten Hopp |
9a4b3f |
|
|
Karsten Hopp |
9a4b3f |
--
|
|
Karsten Hopp |
9a4b3f |
hundred-and-one symptoms of being an internet addict:
|
|
Karsten Hopp |
9a4b3f |
104. When people ask about the Presidential Election you ask "Which country?"
|
|
Karsten Hopp |
9a4b3f |
|
|
Karsten Hopp |
9a4b3f |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
9a4b3f |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
9a4b3f |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
9a4b3f |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|