1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-19 03:52:17 +00:00
freebsd-ports/sysutils/synergy/files/patch-lib__server__CServer.cpp
Kevin Lo dd66eb13d3 Fix a bug when a Windows XP client sends an invalid mouse position to
the server at initial connect.

PR: ports/114869
Submitted by: ehaupt
2007-07-25 01:25:03 +00:00

31 lines
947 B
C++

--- ./lib/server/CServer.cpp.orig 2006-04-02 03:47:04.000000000 +0200
+++ ./lib/server/CServer.cpp 2007-07-24 16:59:59.000000000 +0200
@@ -434,16 +434,23 @@
SInt32 x, SInt32 y, bool forScreensaver)
{
assert(dst != NULL);
+ assert(m_active != NULL);
+
+ LOG((CLOG_INFO "switch from \"%s\" to \"%s\" at %d,%d", getName(m_active).c_str(), getName(dst).c_str(), x, y));
+
#ifndef NDEBUG
{
SInt32 dx, dy, dw, dh;
dst->getShape(dx, dy, dw, dh);
- assert(x >= dx && y >= dy && x < dx + dw && y < dy + dh);
+
+ if(!(x >= dx && y >= dy && x < dx + dw && y < dy + dh)) {
+ LOG((CLOG_ERR "debug check failed"));
+ LOG((CLOG_ERR "x=%d dx=%d dw=%d", x, dx, dw));
+ LOG((CLOG_ERR "y=%d dy=%d dh=%d", y, dy, dh));
+ assert(0);
+ }
}
#endif
- assert(m_active != NULL);
-
- LOG((CLOG_INFO "switch from \"%s\" to \"%s\" at %d,%d", getName(m_active).c_str(), getName(dst).c_str(), x, y));
// stop waiting to switch
stopSwitch();