fixes to avoid update delays.

This commit is contained in:
crs 2001-05-13 12:21:11 +00:00
parent 2155c00c44
commit d0594ea9f3
2 changed files with 10 additions and 1 deletions

View File

@ -7,6 +7,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netinet/tcp.h> // FIXME -- for disabling nagle algorithm
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <netdb.h> #include <netdb.h>
@ -29,6 +30,13 @@ CUnixTCPSocket::CUnixTCPSocket() : m_fd(-1),
::close(m_fd); ::close(m_fd);
throw XSocketCreate(::strerror(errno)); throw XSocketCreate(::strerror(errno));
} }
// turn off Nagle algorithm. we send lots of really short messages.
struct protoent* p = getprotobyname("tcp");
if (p) {
int on = 1;
setsockopt(m_fd, p->p_proto, TCP_NODELAY, &on, sizeof(on));
}
} }
CUnixTCPSocket::CUnixTCPSocket(int fd) : m_fd(fd), CUnixTCPSocket::CUnixTCPSocket(int fd) : m_fd(fd),

View File

@ -199,7 +199,8 @@ void CXScreen::onMouseMove(SInt32 x, SInt32 y)
assert(m_display != NULL); assert(m_display != NULL);
assert(m_primary == false); assert(m_primary == false);
XTestFakeMotionEvent(m_display, m_screen, x, y, CurrentTime); ::XTestFakeMotionEvent(m_display, m_screen, x, y, CurrentTime);
::XSync(m_display, False);
} }
void CXScreen::onMouseWheel(SInt32) void CXScreen::onMouseWheel(SInt32)