From d0594ea9f32fc3175e0b868dbdb014ba4514ab7c Mon Sep 17 00:00:00 2001 From: crs Date: Sun, 13 May 2001 12:21:11 +0000 Subject: [PATCH] fixes to avoid update delays. --- CUnixTCPSocket.cpp | 8 ++++++++ CXScreen.cpp | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CUnixTCPSocket.cpp b/CUnixTCPSocket.cpp index ebec593b..99cd1ecd 100644 --- a/CUnixTCPSocket.cpp +++ b/CUnixTCPSocket.cpp @@ -7,6 +7,7 @@ #include #include #include +#include // FIXME -- for disabling nagle algorithm #include #include #include @@ -29,6 +30,13 @@ CUnixTCPSocket::CUnixTCPSocket() : m_fd(-1), ::close(m_fd); 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), diff --git a/CXScreen.cpp b/CXScreen.cpp index bd683eb4..1f738fc2 100644 --- a/CXScreen.cpp +++ b/CXScreen.cpp @@ -199,7 +199,8 @@ void CXScreen::onMouseMove(SInt32 x, SInt32 y) assert(m_display != NULL); 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)