diff options
Diffstat (limited to 'common/rfb/VNCServerST.cxx')
-rw-r--r-- | common/rfb/VNCServerST.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx index e15cd701..81eed37a 100644 --- a/common/rfb/VNCServerST.cxx +++ b/common/rfb/VNCServerST.cxx @@ -1,5 +1,5 @@ /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - * Copyright 2009-2014 Pierre Ossman for Cendio AB + * Copyright 2009-2017 Pierre Ossman for Cendio AB * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -82,6 +82,7 @@ VNCServerST::VNCServerST(const char* name_, SDesktop* desktop_) : blHosts(&blacklist), desktop(desktop_), desktopStarted(false), blockCounter(0), pb(0), name(strDup(name_)), pointerClient(0), comparer(0), + cursor(new Cursor(0, 0, Point(), NULL)), renderedCursorInvalid(false), queryConnectionHandler(0), keyRemapper(&KeyRemapper::defInstance), lastConnectionTime(0), disableclients(false), @@ -113,6 +114,8 @@ VNCServerST::~VNCServerST() if (comparer) comparer->logStats(); delete comparer; + + delete cursor; } @@ -314,7 +317,6 @@ void VNCServerST::setPixelBuffer(PixelBuffer* pb_, const ScreenSet& layout) } comparer = new ComparingUpdateTracker(pb); - cursor.setPF(pb->getPF()); renderedCursorInvalid = true; // Make sure that we have at least one screen @@ -430,14 +432,11 @@ void VNCServerST::add_copied(const Region& dest, const Point& delta) } void VNCServerST::setCursor(int width, int height, const Point& newHotspot, - const void* data, const void* mask) + const rdr::U8* data) { - cursor.hotspot = newHotspot; - cursor.setSize(width, height); - cursor.imageRect(cursor.getRect(), data); - memcpy(cursor.mask.buf, mask, cursor.maskLen()); - - cursor.crop(); + delete cursor; + cursor = new Cursor(width, height, newHotspot, data); + cursor->crop(); renderedCursorInvalid = true; @@ -618,8 +617,9 @@ bool VNCServerST::checkUpdate() Region toCheck = ui.changed.union_(ui.copied); if (renderCursor) { - Rect clippedCursorRect - = cursor.getRect(cursorPos.subtract(cursor.hotspot)).intersect(pb->getRect()); + Rect clippedCursorRect = Rect(0, 0, cursor->width(), cursor->height()) + .translate(cursorPos.subtract(cursor->hotspot())) + .intersect(pb->getRect()); if (!renderedCursorInvalid && (toCheck.intersect(clippedCursorRect) .is_empty())) { @@ -640,7 +640,7 @@ bool VNCServerST::checkUpdate() comparer->getUpdateInfo(&ui, pb->getRect()); if (renderCursor) { - renderedCursor.update(pb, &cursor, cursorPos); + renderedCursor.update(pb, cursor, cursorPos); renderedCursorInvalid = false; } |