Fixed handling of screen resolution changes.

This commit is contained in:
crs 2004-05-16 18:04:36 +00:00
parent 5a1650914a
commit 93d74a1fda
3 changed files with 21 additions and 12 deletions

View File

@ -334,7 +334,8 @@ CServerProxy::sendInfo(const CClientInfo& info)
LOG((CLOG_DEBUG1 "sending info shape=%d,%d %dx%d", info.m_x, info.m_y, info.m_w, info.m_h));
CProtocolUtil::writef(m_stream, kMsgDInfo,
info.m_x, info.m_y,
info.m_w, info.m_h, 0, 0, 0);
info.m_w, info.m_h, 0,
info.m_mx, info.m_my);
}
KeyID
@ -779,6 +780,7 @@ CServerProxy::queryInfo()
{
CClientInfo info;
m_client->getShape(info.m_x, info.m_y, info.m_w, info.m_h);
m_client->getCursorPos(info.m_mx, info.m_my);
sendInfo(info);
}

View File

@ -218,9 +218,11 @@ CClientProxy1_0::getShape(SInt32& x, SInt32& y, SInt32& w, SInt32& h) const
}
void
CClientProxy1_0::getCursorPos(SInt32&, SInt32&) const
CClientProxy1_0::getCursorPos(SInt32& x, SInt32& y) const
{
assert(0 && "shouldn't be called");
// note -- this returns the cursor pos from when we last got client info
x = m_info.m_mx;
y = m_info.m_my;
}
void
@ -372,9 +374,9 @@ bool
CClientProxy1_0::recvInfo()
{
// parse the message
SInt16 x, y, w, h, dummy1, dummy2, dummy3;
SInt16 x, y, w, h, dummy1, mx, my;
if (!CProtocolUtil::readf(getStream(), kMsgDInfo + 4,
&x, &y, &w, &h, &dummy1, &dummy2, &dummy3)) {
&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));
@ -385,10 +387,12 @@ CClientProxy1_0::recvInfo()
}
// save
m_info.m_x = x;
m_info.m_y = y;
m_info.m_w = w;
m_info.m_h = h;
m_info.m_x = x;
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;
// acknowledge receipt
LOG((CLOG_DEBUG1 "send info ack to \"%s\"", getName().c_str()));

View File

@ -201,7 +201,7 @@ static const char kMsgDClipboard[] = "DCLP%1i%4i%s";
// $2 = coordinate of topmost pixel on secondary screen,
// $3 = width of secondary screen in pixels,
// $4 = height of secondary screen in pixels,
// $5 = size of warp zone,
// $5 = size of warp zone, (obsolete)
// $6, $7 = the x,y position of the mouse on the secondary screen.
//
// the secondary screen must send this message in response to the
@ -274,8 +274,11 @@ public:
//! Obsolete (jump zone size)
SInt32 obsolete1;
//! Obsolete (mouse position)
SInt32 obsolete2, obsolete3;
//! Mouse position
/*!
The current location of the mouse cursor.
*/
SInt32 m_mx, m_my;
};
#endif