mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 17:59:20 -04:00
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
This commit is contained in:
parent
67f7a2644f
commit
dd66eb13d3
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=196235
3 changed files with 59 additions and 1 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
PORTNAME= synergy
|
||||
PORTVERSION= 1.3.1
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= sysutils
|
||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
||||
MASTER_SITE_SUBDIR= ${PORTNAME}2
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
--- ./lib/server/CClientProxy1_0.cpp.orig 2006-04-02 03:47:03.000000000 +0200
|
||||
+++ ./lib/server/CClientProxy1_0.cpp 2007-07-24 16:59:59.000000000 +0200
|
||||
@@ -401,7 +401,7 @@
|
||||
&x, &y, &w, &h, &dummy1, &mx, &my)) {
|
||||
return false;
|
||||
}
|
||||
- LOG((CLOG_DEBUG "received client \"%s\" info shape=%d,%d %dx%d", getName().c_str(), x, y, w, h));
|
||||
+ LOG((CLOG_DEBUG "received client \"%s\" info shape=%d,%d %dx%d mouse=%d,%d", getName().c_str(), x, y, w, h, mx, my));
|
||||
|
||||
// validate
|
||||
if (w <= 0 || h <= 0) {
|
||||
@@ -413,8 +413,14 @@
|
||||
m_info.m_y = y;
|
||||
m_info.m_w = w;
|
||||
m_info.m_h = h;
|
||||
- m_info.m_mx = mx;
|
||||
- m_info.m_my = my;
|
||||
+
|
||||
+ if(mx >= x && mx < x+w && my >= y && my < y+h) {
|
||||
+ m_info.m_mx = mx;
|
||||
+ m_info.m_my = my;
|
||||
+ } else {
|
||||
+ m_info.m_mx = x + w/2;
|
||||
+ m_info.m_my = y + h/2;
|
||||
+ }
|
||||
|
||||
// acknowledge receipt
|
||||
LOG((CLOG_DEBUG1 "send info ack to \"%s\"", getName().c_str()));
|
30
sysutils/synergy/files/patch-lib__server__CServer.cpp
Normal file
30
sysutils/synergy/files/patch-lib__server__CServer.cpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
--- ./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();
|
Loading…
Add table
Reference in a new issue