Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: https://forum.uvnc.com/viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: https://forum.uvnc.com/viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://x.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Cursor color broken in 16 bit color depth.

Post Reply
tyan0
8
8
Posts: 21
Joined: 2021-08-10 03:14

Cursor color broken in 16 bit color depth.

Post by tyan0 »

Versions:
UltraVNC viewer: 1.3.3 dev 10, 1.3.2, 1.2.4.0, etc.
vncserver: TigerVNC server 1.9.0+dfsg-3+deb10u3 (debian buster)
Server OS: Debian GNU Linux (buster)
Client OS: Windows 10 x64 (21H1)

Overview:
If UltraVNC viewer connects to tigervnc-server (in Linux) with 16 bit color depth, cursor color is broken.

Steps to reproduce the issue:
1. Install tigervnc-standalone-server in debian (buster).
2. Start vncserver in debian with

Code: Select all

vncserver -geometry 1024x768 -depth 16
3. Connect to the vncserver using UltraVNC viewer (any version) from Windows10 client machine.

Resulting screenshot with the issue (Enlarged x4):
Image

Expected screenshot without the issue (Enlarged x4):
Image

I looked into this problem with UltraVNC source code in GitHub, and found the following patch fixes the issue.

The patch which fixes the issue:

Code: Select all

diff --git a/vncviewer/ClientConnectionCursor.cpp b/vncviewer/ClientConnectionCursor.cpp
index 3d3b1a6..e543519 100755
--- a/vncviewer/ClientConnectionCursor.cpp
+++ b/vncviewer/ClientConnectionCursor.cpp
@@ -94,11 +94,13 @@ void ClientConnection::ReadCursorShape(rfbFramebufferUpdateRectHeader *pfburh) {
 				p++;
 				break;
 			case 16:
-				rcSource[i] = COLOR_FROM_PIXEL16_ADDRESS(p);
+				//rcSource[i] = COLOR_FROM_PIXEL16_ADDRESS(p);
+				rcSource[i] = *(CARD16*)p; /* No conversion because BI_BITFIELDS is used. */
 				p += 2;
 				break;
 			case 32:
-				rcSource[i] = COLOR_FROM_PIXEL32_ADDRESS(p);
+				//rcSource[i] = COLOR_FROM_PIXEL32_ADDRESS(p);
+				rcSource[i] = *(CARD32*)p; /* No conversion because BI_BITFIELDS is used. */
 				p += 4;
 				break;
 			}
tyan0
8
8
Posts: 21
Joined: 2021-08-10 03:14

Re: Cursor color broken in 16 bit color depth.

Post by tyan0 »

Sorry, the patch was against 1.3.3 dev 10. Here is the patch against git head (553dc8815d65711472fcd45fa01bd922d5fac686).
https://tyan0.yr32.net/files/mouse-cors ... -patch.zip
Post Reply