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)