浏览代码

Clear client cursor when switching to server side

Otherwise the client can end up with two visible cursors.
tags/v1.8.90
Pierre Ossman 6 年前
父节点
当前提交
71ca8d546b
共有 1 个文件被更改,包括 10 次插入1 次删除
  1. 10
    1
      common/rfb/VNCSConnectionST.cxx

+ 10
- 1
common/rfb/VNCSConnectionST.cxx 查看文件

@@ -64,6 +64,8 @@ struct RTTInfo {
unsigned inFlight;
};

static Cursor emptyCursor(0, 0, Point(0, 0), NULL);

VNCSConnectionST::VNCSConnectionST(VNCServerST* server_, network::Socket *s,
bool reverse)
: sock(s), reverseConnection(reverse),
@@ -357,6 +359,9 @@ bool VNCSConnectionST::getComparerState()
void VNCSConnectionST::renderedCursorChange()
{
if (state() != RFBSTATE_NORMAL) return;
// Are we switching between client-side and server-side cursor?
if (damagedCursorRegion.is_empty() != needRenderedCursor())
setCursorOrClose();
if (!damagedCursorRegion.is_empty())
removeRenderedCursor = true;
if (needRenderedCursor()) {
@@ -1132,7 +1137,11 @@ void VNCSConnectionST::setCursor()
if (state() != RFBSTATE_NORMAL)
return;

cp.setCursor(*server->cursor);
// We need to blank out the client's cursor or there will be two
if (needRenderedCursor())
cp.setCursor(emptyCursor);
else
cp.setCursor(*server->cursor);

if (!writer()->writeSetCursorWithAlpha()) {
if (!writer()->writeSetCursor()) {

正在加载...
取消
保存