mirror of
https://github.com/debauchee/barrier.git
synced 2024-12-26 20:53:22 +03:00
Fixed handling of screen resolution changes.
This commit is contained in:
parent
5a1650914a
commit
93d74a1fda
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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()));
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user